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()
wDir = numpy.array([0.0, 0, 1.0]) 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()
wDir = numpy.array([0.0, 0, 1.0]) vDir = numpy.cross(wDir, uDir) points = [] cutSec = [] for theta in range(360): theta = math.radians(theta) point = sec_origin + (R * math.cos(theta)) * uDir + ( R * math.sin(theta)) * vDir cut = sec_origin + (r * math.cos(theta)) * uDir + (r * math.sin(theta)) * vDir points.append(point) cutSec.append(cut) edges = makeEdgesFromPoints(points) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = 10 * (wDir) # extrudeDir is a numpy array prism = makePrismFromFace(aFace, extrudeDir) edges = makeEdgesFromPoints(cutSec) wire = makeWireFromEdges(edges) aFace = makeFaceFromWire(wire) extrudeDir = 10 * (wDir) # extrudeDir is a numpy array cuts = makePrismFromFace(aFace, extrudeDir) O = BRepAlgoAPI_Cut(prism, cuts).Shape() display.DisplayShape(O, update=True) display.DisableAntiAliasing()