Home
Reply
Visitor
acis_user
Posts: 4

Emergency!! 'bs2_curve' parameterization

[ Edited ]
Hello,
'pcurve' with explicit flavor contains direct 'bs2_curve' and a 'surface' pointer reference.
So everytime, while making pcurve parameterization same as 'coedge', is it also necessary
to change (or flip) bs2_curve parameterization (in accordance with the direction of the 'curve')?
I am creating 'pcurve' using edge curve and surface. So, 'bs2_curve' gets calculated in the background.

Thanks

Spatial Employee
Brian
Posts: 20

Re: Emergency!! 'bs2_curve' parameterization

Hello,

 

Have you considered using api_approx to make your bs2_curve? There is a signature that takes a coedge and returns a bs2_curve. The bs2_curve will be oriented the same as the coedge, and you can specify the accuracy you need - two advantages over trying to re-use the bs2_curve owned by the pcurve.

 

For more info, see:

http://doc.spatial.com/index.php/Approximations

and specifically

http://doc.spatial.com/index.php/Approximations#Example_2._Default_COEDGE_Approximation

 

Best regards,

Brian

Spatial Employee
kedarp
Posts: 1

Re: Emergency!! 'bs2_curve' parameterization

Thanks for posting your question. Let me share my understanding of your requirement, you want to create bs2_curve that runs along with the same parameterization as the curve of EDGE. Is that right?

 

As Brian has already explained, one can get a bs2_curve along the coedge using api_approx(). But if the bs2_curve has to travel along the curve, then one needs to consider the senses of COEDGE and EDGE. Steps are:

1)      Create bs2_curve using api_approx()

2)      Reverse the using bs2_curve_reverse(), if one of the senses (EDGE, COEDGE) is reversed i.e. if the senses of edge and coedge are both FORWARD or both REVERSED then the bs2_curve shouldnt be reversed.

 

In case of COEDGEs having pcurves computed and stored, api_approx() has a cost of recomputation, as it attempts to fit a new bs2_curve. If you prefer to avoid a re-computation then you would need to pull the bs2_curve from pcurve of COEDGE. But thats quite a tricky process as it involves consideration of more factors. I can write that in detail in case you really prefer the pcurve route instead of api_approx().

Visitor
acis_user
Posts: 4

Re: Emergency!! 'bs2_curve' parameterization

[ Edited ]

Hello,

Thanks a lot Brian and Kedarp for the reply,

I tried Brian's suggestion and it works perfectly fine for me. Although, I already have 'pcurve' computed and stored so creating 'bs2_curve' again indeed has a cost of recomputation. So, I tried kedarp's suggestion. I am  getting 'bs2_curve' from 'pcurve' using API (pcurve->cur()) and reversing it using API 'bs2_curve_reverse' based on the condition mentioned here. This approch is also working fine for me.  As I said earlier, I am creating 'pcurve' using edge 'curve' and 'surface' so 'bs2_curve' gets computed in the background. (I am creating 'pcurve' only in the case of spline surface)

kedarp, can you please mention here the 'tricky process' of pulling 'bs2_curve' out of 'pcurve' of 'COEDGE', which includes consideration of other factors as well.

Thanks again,