Need help with Sum surface in Rhino

Hello Guys,

I am working on converting Rhino 3dm file to Parasolid.
While traversing Brep object I am getting ON_SumSurface object. Sum surface have two curve (first one is a base curve and second one is extrude curve).
For creating sum surface in Parasolid I have used the Sweep API which take the base curve and extrude curve as input. I have directly passed the data (that I am getting for Sum surface from Rhino) to the Parasolid API.
It is creating a surface in Parasolid but the location is not correct. If I write Sum surface using NURBS form data in Parasolid then surface get created at correct location.

Do I need to add some value to the Sum surface curve data before using it in Parasolid. Because I have faced similar problem with extrude surface which I have fixed by adding path axis start point to all of the curve coordinates.

Could you please let me know why I am getting such problem with sum surface data. Should I always create Sum surface using NURBS data only.

Note:- I am using OpenNURBS SDK for traversing 3dm file.

Thanks in advance, Please let me know your suggestion ASAP.

Hello Guys,
Hello @dale
Awaiting your reply on this topic.
I need to work on this ASAP.
Please look into it.

Hi @psomesh94,

If you need boundary curves from an ON_SumSurface object, it is best to get them using ON_SumSurface::IsoCurve(), rather than accessing the ON_SumSurface::m_curve member directly.

For example:

const ON_SumSurface* sum_srf = ON_SumSurface::Cast(srf);
if (nullptr != sum_srf)
  ON_Interval domain0 = sum_srf->Domain(0);
  ON_Interval domain1 = sum_srf->Domain(1);

  // Note carefully: ON_SumSurface::IsoCurve allocates memory
  // for the output curve. The caller is responsible for
  // freeing this memory when finished.

  ON_Curve* west = sum_srf->IsoCurve(1, domain0[0]);
  ON_Curve* east = sum_srf->IsoCurve(1, domain0[1]);
  ON_Curve* north = sum_srf->IsoCurve(0, domain1[1]);
  ON_Curve* south = sum_srf->IsoCurve(0, domain1[0]);

Also, if the Parasolid Sweep API just creates a NURBS surface, then you might just as well use the NURB form of the ON_SumSurface object.

Hope this helps.

– Dale

Thanks for Reply @dale,
We are creating Sum surface using NURBS form only, using IsoCurve will be more complex so we will go with the NURBS form.