https://www.freecadweb.org/wiki/Manual: ... g_geometry
Working thru the part to make the pill shape.
http://www.freecadweb.org/wiki/images/9 ... hon_03.jpg
Manual says that
I'm not finding that to be true, if we put in the Wire per the manual, we fail to get closed geometry. However if we put the Wire together in a clockwise rotation the part closes. OpenCasCade is not as intolerant of unordered geometry as the author thought.Once we have a series of Edges, we can now form a Wire, by giving it a list of Edges. We don't need to take care of the order. OpenCasCade, the geometry "engine" of FreeCAD, is extraordinarily tolerant to unordered geometry. It will sort out what to do:
Extract of the manual commands entered into the Python console of a new document:
Code: Select all
import Part
V1 = FreeCAD.Vector(0,10,0)
V2 = FreeCAD.Vector(30,10,0)
V3 = FreeCAD.Vector(30,-10,0)
V4 = FreeCAD.Vector(0,-10,0)
L1 = Part.Line(V1,V2)
L2 = Part.Line(V4,V3)
VC1 = FreeCAD.Vector(-10,0,0)
C1 = Part.Arc(V1,VC1,V4)
VC2 = FreeCAD.Vector(40,0,0)
C2 = Part.Arc(V2,VC2,V3)
E1 = Part.Edge(L1)
E2 = Part.Edge(L2)
E3 = Part.Edge(C1)
E4 = Part.Edge(C2)
W = Part.Wire([E1,E2,E3,E4])
print( W.isClosed() )
F = Part.Face(W)
P = F.extrude(FreeCAD.Vector(0,0,10))
myObj2 = FreeCAD.ActiveDocument.addObject("Part::Feature","My_Strange_Solid")
myObj2.Shape = P
FreeCAD.ActiveDocument.recompute()
Code: Select all
W = Part.Wire([E1,E4,E2,E3])
OS: Linux
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.Unknown
Build type: Unknown
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
Linux 4.9.9-200.fc25.x86_64 #1 SMP Thu Feb 9 17:28:13 UTC 2017 x86_64 GNU/Linux