Closed rohan-kekatpure closed 3 years ago
I discovered that I am not able to create a PCurve at all. So I need to dig a bit more and may open another issue with a more focused issue.
The BRep_Tool().CurveOnSurface
function has 4 different signatures, see https://dev.opencascade.org/doc/refman/html/class_b_rep___tool.html#afec881ea1e3d42d9de0999d8aa5f7544
Two of them return a Geom2d_Curve, and other two return nothing in c++ (void type), but will return a tuple (First, Last).
Thanks @tpaviot.
My real issue is the following. I'm constructing a brand new TopoDS_Face (with new wires, edges etc). The PCurve of the newly created edges on the newly created face does not yet exist. So BRep_Tool.CurveOnSurface
returns a null. The PCurve first has to be constructed and attached to the new edge (using UpdateEdge
) before BRep_Tool.CurveOnSurface
can return it thereafter. However, I'm unable to create/compute this curve through Python because the PCurve construction routines (ShapeConstruct_ProjectCurveOnSurface().Perform()
) requires an empty handle to a Geom2d_Curve
. I dont know how to create empty Geom2d_Curve
. I have looked through the docs and also scanned all functions that return a Geom2d_Curve
. This difficulty was the subject of Issue # 971.
I ended up migrating to C++, and I could successfully compute the PCurve of the new edge on the new face using ShapeConstruct_ProjectCurveOnSurface()
. So theoretically I'm not blocked and can continue my development in C++. But I would really like to use PythonOCC since my development and iterations are so much faster. Anyway, if you could point me to how to create empty Geom2d_Curve
handle for passing to ShapeConstruct_ProjectCurveOnSurface().Perform()
or show how ShapeConstruct_ProjectCurveOnSurface().Perform()
should be used, that would be a great help. Thanks.
I'm having difficulty getting PythonOCC to compute PCurve of a newly created face. Specifically the command
BRep_Tool().CurveOnSurface(newedge, newface)
fails to return the PCurve. It just returns the tuple(0.0, 0.0)
. As far as I can tell, I have set up the topology correctly. The constituent wires and edges all have the expected structure. It is just that theCurveOnSurface
command fails to compute the PCurve.I know that
newedge
lies onnewface
. How?newface
is just a face created from the BSpline of the original face andnewedge
is an edge created by combining splines of the edges on the original face. So I know that the projection must compute.Here is the relevant code (apologies for the wall of code, but the setup steps are long):