Hello,
I am getting similar results. In the attached images, I project a face unto a cylinder. Both sit on the XY-plane. So, in addition to two projections on the near and far surfaces, I am getting a projection on the bottom of the cylinder. I cannot filter the resulting wires because their edges are not logically grouped. In this example, I get two wires. The first wire has 7 edges (highlighted in green) and the second wire has 1 edge (in black on the bottom face). Any help in resolving this is much appreciated.
Code: Select all
import Part
doc = FreeCAD.newDocument('NMT-Explode')
Gui.ActiveDocument.ActiveView.viewAxonometric()
# CREATE A FACE
v1 = App.Vector(7.0,-0.5,0.0)
v2 = App.Vector(7.0,0.5,0.0)
v3 = App.Vector(7.0,0.5,2.5)
v4 = App.Vector(7.0,-0.5,2.5)
edge1 = Part.makeLine(v1, v2)
edge2 = Part.makeLine(v2, v3)
edge3 = Part.makeLine(v3, v4)
edge4 = Part.makeLine(v4, v1)
wire = Part.Wire([edge1,edge2,edge3,edge4])
face = Part.Face(wire)
Part.show(face)
# CREATE A CYLINDER
cylinder = Part.makeCylinder(4,6,App.Vector(0,0,0))
Part.show(cylinder)
doc.ActiveObject.ViewObject.Transparency=50
# PROJECT EVERY WIRE IN FACE UNTO THE CYLINDER
for w in range(len(face.Wires)):
projection=c.makeParallelProjection(face.Wires[w], App.Vector(-1,0,0))
Part.show(projection)
Gui.SendMsgToActiveView("ViewFit")
- ProjectFaceOnCylinder.png (47.35 KiB) Viewed 1286 times