def create_model(self): Pnt = getGpPt(self.sec_origin) edges = makeEdgesFromPoints(self.points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = self.L * (self.wDir) # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) return prism
def create_model(self): edges = makeEdgesFromPoints(self.points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) coneOrigin = self.sec_origin revolve_axis = gp_Ax1(getGpPt(coneOrigin), getGpDir(self.wDir)) aSweep = BRepPrimAPI_MakeRevol(aFace, revolve_axis, math.radians(self.coneAngle)).Shape() return aSweep
def create_model(self): Pnt = getGpPt(self.sec_origin) edges = makeEdgesFromPoints(self.points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = self.L * (self.wDir) # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) return prism # b = 5 # h = 5 # L = 50 # # channel = FilletWeld(b,h,L) # # angles = channel.place() # point = channel.compute_params() # prism = channel.create_model() # display.DisplayShape(prism, update=True) # display.ExportToImage('./CAD_image.png') # display.DisableAntiAliasing() # start_display()
vDir = numpy.cross(wDir, uDir) xp = [] yp = [] for x in [0,1,0.02]: y_up = + 0.6*(0.2969*sqrt(x) - 0.1260*x - 0.3516*x*x + 0.2843*x*x*x - 0.1015*x*x*x*x) * vDir y_dn = - 0.6*(0.2969*sqrt(x) - 0.1260*x - 0.3516*x*x + 0.2843*x*x*x - 0.1015*x*x*x*x) * vDir x = x xp.append(x*uDir) yp.append(y_up) yp.append(y_dn) points = ([xp,yp]) edges = makeEdgesFromPoints(points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = 10 * (wDir) # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) # return prism display.DisplayShape(prism, update=True) # display.ExportToImage('./CAD_image.png') display.DisableAntiAliasing() start_display()