Home
Reply
Contributor
kobofa
Posts: 10

Get the B-spline curve on the B-spline surface

Hello! 

 

i made a B-spline surface  using the api function (api_mk_fa_spl_ctrlpts).

then, i want to get the  B-spline curve of boundary of Surface.

but can't find that. 

 

is there any API function? 

 

Is there anyone who knows where that thing is?  

I don't know in detail because i'm a  beginner in this field. 

 

please help me ~

Bspline.JPG
Spatial Employee
asdf
Posts: 93

Re: Get the B-spline curve on the B-spline surface

Hi

 

I think the thing to do is first get the edges then get the geometry from them.  This can be accomplished as follows:

 

 

  • Get the list of edges from the new face

 

#include "kernapi.hxx"

//..

 

ENTITY_LIST edges;

api_get_edges(face, edges );

 

 

  • For each edge, get the underlying geometry
#include "acistype.hxx"
#include "edge.hxx"
#include "curve.hxx"
#include "curdef.hxx"
#include "bs3curve.hxx"
//....
EDGE* this_edge=NULL;
for( edges.init(); this_edge=edges.next(); )
{
CURVE* this_CURVE = this_edge->geometry();
if( !this_CURVE )
continue;
curve const& this_curve = this_CURVE->equation();
if( is_intcurve(&this_curve) )
{
intcurve const& intcu = (intcurve const&)this_curve;
bs3_curve bs3 = intcu->cur();
}
}
Some comments regarding the above: you are usually best off sticking to the highest level interface which will do what you want to do (e.g. APIs).  
There are two types of CURVEs in ACIS analytics (ELLIPSE, STRAIGHT) and intcurves (including exact bsplines and procedural curves).  To get the bsplines from the edges of the face you just made, we get the edges, then check that they are intcurves.  Any intcurve has a bs3_curve (NURBS) approximation, but for procedural bsplines this won't be exact.  If you just want to evaluate the curve, the interface for lower case curve will allow you to do that.  The class hierarcy is a bit complex because there are different levels of responsibility: EDGE is a piece of topology (so it knows its geometry but it also knows how its geometry connects up with the rest of the model), CURVE is an ENTITY so it knows how to save and restore itself, as well as maintain its history and transactional responsibilities.  Lower case curve knows how to evaluate itself.  The same pattern is mirrored for FACE/SURFACE/surface.  FACE is topology, SURFACE is an entity which owns the lower case surface which can be evaluated.  It gets pretty complex.
Depending upon what you are trying to do there may be a higher level interface to do it.  The APIs are generally better tested and easier to use.  I'd be happy to discuss other workflows as well.
hope this helps.
Eric

 

Contributor
kobofa
Posts: 10

Re: Get the B-spline curve on the B-spline surface

Hi Eric 
Thank you for your answer.
I didn't understand competly yet. But i know what you said to me. 
I will study more. 
I really appreciate to you. 
Kobofa