edwilliams16 wrote: ↑Fri Aug 05, 2022 4:35 am
so face.curveOnSurface(edge) maps the edge on the surface on which face lies
More precisely, or maybe because english is not my native language, I would say that
face.curveOnSurface(edge) returns the 2D representation of edge on face, if it already exist, otherwise, one has to project edge on face and use the projected edge instead.
edwilliams16 wrote: ↑Fri Aug 05, 2022 4:35 am
However, I don't know just what
indx = 0
curv, obj, placement, fp, lp = edge.curveOnSurface(indx)
is doing - particularly what is indx indexing?
An edge can contain several 2D pcurves (on various surfaces), and possibly also a 3D curve (but in FC, this 3D curve is always automatically computed)
edge.curveOnSurface(indx) simply returns the pcurve stored at index
indx.
So you have access to all the pcurves stored in the edge, without having to specify a face.
Example code, where an edge gets loaded with several pcurves :
Code: Select all
import Part
vec = FreeCAD.Vector
poles1 = [vec(0, 0, 0), vec(5, 5, 0), vec(10, 0, 0)]
poles2 = [vec(-5, 0, 5), vec(5, 10, 5), vec(15, 0, 3)]
poles3 = [vec(-3, 0, 8), vec(5, 12, 8), vec(20, 0, 10)]
e1 = Part.BSplineCurve(poles1).toShape()
e2 = Part.BSplineCurve(poles2).toShape()
e3 = Part.BSplineCurve(poles3).toShape()
rs1 = Part.makeRuledSurface(e1, e2)
ext = e1.extrude(vec(0,0,10))
rs2 = Part.makeRuledSurface(e1, e3)
e1.curveOnSurface(0)
e1.curveOnSurface(1)
e1.curveOnSurface(2)
e1.curveOnSurface(3)