Got the revolve operation working by preventing the wire(s) from being centered.

This commit is contained in:
Jeremy Wright 2014-10-08 11:32:41 -04:00
parent 2c3e34becc
commit f20d52ebd9
2 changed files with 4 additions and 5 deletions

View File

@ -753,16 +753,15 @@ class Solid(Shape):
* there cannot be any intersecting or self-intersecting wires * there cannot be any intersecting or self-intersecting wires
* wires must be listed from outside in * wires must be listed from outside in
* more than one levels of nesting is not supported reliably * more than one levels of nesting is not supported reliably
* the wire(s) that you're revolving cannot be centered
This method will attempt to sort the wires, but there is much work remaining to make this method This method will attempt to sort the wires, but there is much work remaining to make this method
reliable. reliable.
""" """
freeCADWires = [outerWire.wrapped] freeCADWires = [outerWire.wrapped]
#my_shape = FreeCADPart.Shape([FreeCADPart.Line(FreeCAD.Vector(0,0,0),FreeCAD.Vector(0,15,0)),FreeCADPart.Line(FreeCAD.Vector(0,15,0),FreeCAD.Vector(15,15,0)),FreeCADPart.Line(FreeCAD.Vector(15,15,0),FreeCAD.Vector(15,0,0)),FreeCADPart.Line(FreeCAD.Vector(15,0,0),FreeCAD.Vector(0,0,0))])
#freeCADWires = FreeCADPart.Wire(my_shape.Edges)
# for w in innerWires: for w in innerWires:
# freeCADWires.append(w.wrapped) freeCADWires.append(w.wrapped)
f = FreeCADPart.Face(freeCADWires) f = FreeCADPart.Face(freeCADWires)
result = f.revolve(FreeCAD.Base.Vector(0,0,0), FreeCAD.Base.Vector(0,1,0), angleDegrees) result = f.revolve(FreeCAD.Base.Vector(0,0,0), FreeCAD.Base.Vector(0,1,0), angleDegrees)

View File

@ -25,7 +25,7 @@ rectange_length = 15.0
angleDegrees = 360.0 angleDegrees = 360.0
#Extrude a cylindrical plate with a rectangular hole in the middle of it #Extrude a cylindrical plate with a rectangular hole in the middle of it
result = cadquery.Workplane("front").rect(rectangle_width, rectange_length).revolve(angleDegrees) result = cadquery.Workplane("front").rect(rectangle_width, rectange_length, False).revolve(angleDegrees)
#Get a cadquery solid object #Get a cadquery solid object
solid = result.val() solid = result.val()