How to export NURBS as Primitive surface?


Hello,

As you can see in the attached image, I have a surface that appears to be a cylinder. However, it is actually defined as a NURBS surface.

When I export this model to a STEP file, I want it to be defined as a CYLINDRICAL_SURFACE according to the AP242 standard, not as a generic B_SPLINE_SURFACE.

What is the correct approach in RhinoCommon to ensure that a NURBS surface, which is geometrically a perfect cylinder, is recognized and exported as an analytic CYLINDRICAL_SURFACE?

Thank you for your help.

how are you sure?

…can you upload a file?

With more study, i noticed it is not geometrically perfect as the process of conversion from SubD to NURBS.

NURBS must be calculated in third degree so maybe it’s defined as third degree of free surface.
Originally what i have is SubD and the vertices of SubD are located perfectly on the cylinderical surface.

And what i want to do is converting this SubD as brep whose surface is defined as CYLINDERICAL_SURFACE.

How can i do this?

Long story short, you are making no sense here. Converting subD to NURBS is not going to give you an ‘exact’ anything. Please post files and what the heck this is all about, what are you exporting TO, again you are making zero sense.

after admiting the lack of accuracy I call that process of conversion: “remodeling”.
and SubD is not the “material” to use.

To answer your actual question, you have no more control off the representation of objects being exported as .stp in RhinoCommon than you do exporting from Rhino manually. The exporter is a black box. Therefore the correct approach is to ensure you have cylindrical objects in your model before starting an export.

Objects created from the NURBS cylinder primitive appear to do what you want (I’m no STEP expert and don’t have any tools for interpreting STEP files, so confirm this for yourself). So do cylinders extruded from a circle.

A SUBD cylinder with the default 4 vertical faces will not do what you want. However one with 8 vertical faces does appear to do so.

HTH
Jeremy

@tim - can you look at this?

@Young_Geon_Park
Did you read further down in the text for the STP export, it is defined as a cylindrical surface, see below. If I open this STP in SolidWorks, it detects the surface as cylindrical. This was generated using the cylinder in Rhino’s solid tools tab.
cylinder solid ap242.stp (4.4 KB)
cylinder solid.3dm (57.4 KB)

As far as using subd to define a “pure” cylindrical surface, it is impossible, see response from @dalelear in this thread [WISH] SubD second degree or changing degree of a SubD? - #5 by martinsiegrist

ISO-10303-21;
HEADER;
/* Generated by software containing ST-Developer

  • from STEP Tools, Inc. (www.steptools.com)
    /
    /
    OPTION: using custom schema-name function */

FILE_DESCRIPTION(
/* description / (‘’),
/
implementation_level */ ‘2;1’);

FILE_NAME(
/* name / ‘cylinder solid ap242’,
/
time_stamp / ‘2025-07-01T21:39:25-04:00’,
/
author / (‘’),
/
organization / (‘’),
/
preprocessor_version / ‘ST-DEVELOPER v19.2’,
/
originating_system / ‘Rhino 8.20’,
/
authorisation */ ‘’);

FILE_SCHEMA ((‘AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF { 1 0 10303 442 3 1 4 }’));
ENDSEC;

DATA;
#10=SHAPE_REPRESENTATION_RELATIONSHIP(‘’,‘’,#59,#13);
#11=PRESENTATION_LAYER_ASSIGNMENT(‘Default’,‘’,(#12));
#12=MANIFOLD_SOLID_BREP(‘brep_1’,#14);
#13=ADVANCED_BREP_SHAPE_REPRESENTATION(‘brep_rep_0’,(#12,#66),#58);
#14=CLOSED_SHELL(‘’,(#15,#16,#17));
#15=ADVANCED_FACE(‘’,(#18),#40,.T.);
#16=ADVANCED_FACE(‘’,(#19),#38,.T.);
#17=ADVANCED_FACE(‘’,(#20),#39,.T.);
#18=FACE_OUTER_BOUND(‘’,#21,.T.);
#19=FACE_OUTER_BOUND(‘’,#22,.T.);
#20=FACE_OUTER_BOUND(‘’,#23,.T.);
#21=EDGE_LOOP(‘’,(#24,#25,#26,#27));
#22=EDGE_LOOP(‘’,(#28));
#23=EDGE_LOOP(‘’,(#29));
#24=ORIENTED_EDGE(‘’,,,#30,.T.);
#25=ORIENTED_EDGE(‘’,,,#31,.T.);
#26=ORIENTED_EDGE(‘’,,,#32,.F.);
#27=ORIENTED_EDGE(‘’,,,#31,.F.);
#28=ORIENTED_EDGE(‘’,,,#30,.F.);
#29=ORIENTED_EDGE(‘’,,,#32,.T.);
#30=EDGE_CURVE(‘’,#36,#36,#34,.T.);
#31=EDGE_CURVE(‘’,#36,#37,#33,.T.);
#32=EDGE_CURVE(‘’,#37,#37,#35,.T.);
#33=(
BOUNDED_CURVE()
B_SPLINE_CURVE(1,(#85,#86),.UNSPECIFIED.,.F.,.F.)
B_SPLINE_CURVE_WITH_KNOTS((2,2),(0.,60.),.UNSPECIFIED.)
CURVE()
GEOMETRIC_REPRESENTATION_ITEM()
RATIONAL_B_SPLINE_CURVE((1.,1.))
REPRESENTATION_ITEM(‘’)
);
#34=CIRCLE(‘’,#64,50.);
#35=CIRCLE(‘’,#65,50.);
#36=VERTEX_POINT(‘’,#82);
#37=VERTEX_POINT(‘’,#83);
#38=PLANE(‘’,#62);
#39=PLANE(‘’,#63);
#40=CYLINDRICAL_SURFACE(‘’,#61,50.);
#41=SHAPE_DEFINITION_REPRESENTATION(#42,#59);
#42=PRODUCT_DEFINITION_SHAPE(,,#44);
#43=PRODUCT_DEFINITION_CONTEXT(‘3D Mechanical Parts’,#48,‘design’);
#44=PRODUCT_DEFINITION(‘A’,‘First version’,#45,#43);
#45=PRODUCT_DEFINITION_FORMATION_WITH_SPECIFIED_SOURCE(‘A’,
‘First version’,#50,.MADE.);
#46=PRODUCT_RELATED_PRODUCT_CATEGORY(‘tool’,‘tool’,(#50));
#47=APPLICATION_PROTOCOL_DEFINITION(‘Draft International Standard’,
‘automotive_design’,1999,#48);
#48=APPLICATION_CONTEXT(
‘data for automotive mechanical design processes’);
#49=PRODUCT_CONTEXT(‘3D Mechanical Parts’,#48,‘mechanical’);
#50=PRODUCT(‘Document’,‘Document’,‘’,(#49));
#51=(
LENGTH_UNIT()
NAMED_UNIT()
SI_UNIT(.MILLI.,.METRE.)
);
#52=(
NAMED_UNIT(
)
PLANE_ANGLE_UNIT()
SI_UNIT(,.RADIAN.) ); #53=DIMENSIONAL_EXPONENTS(0.,0.,0.,0.,0.,0.,0.); #54=PLANE_ANGLE_MEASURE_WITH_UNIT(PLANE_ANGLE_MEASURE(0.01745329252),#52); #55=( CONVERSION_BASED_UNIT('DEGREES',#54) NAMED_UNIT(#53) PLANE_ANGLE_UNIT() ); #56=( NAMED_UNIT(*) SI_UNIT(,.STERADIAN.)
SOLID_ANGLE_UNIT()
);
#57=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(0.01),#51,
‘DISTANCE_ACCURACY_VALUE’,
‘Maximum model space distance between geometric entities at asserted c
onnectivities’);
#58=(
GEOMETRIC_REPRESENTATION_CONTEXT(3)
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#57))
GLOBAL_UNIT_ASSIGNED_CONTEXT((#56,55,#51))
REPRESENTATION_CONTEXT(‘ID1’,‘3D’)
);
#59=SHAPE_REPRESENTATION(‘Document’,(#60,#66),#58);
#60=AXIS2_PLACEMENT_3D(,#78,#67,#68); #61=AXIS2_PLACEMENT_3D('',#79,#69,);
#62=AXIS2_PLACEMENT_3D(‘’,#80,#70,); #63=AXIS2_PLACEMENT_3D('',#81,#71,);
#64=AXIS2_PLACEMENT_3D(,#84,#72,#73); #65=AXIS2_PLACEMENT_3D(,#87,#74,#75);
#66=AXIS2_PLACEMENT_3D($,#88,#76,#77);
#67=DIRECTION(‘’,(0.,0.,1.));
#68=DIRECTION(‘’,(1.,0.,0.));
#69=DIRECTION(‘’,(0.,0.,1.));
#70=DIRECTION(‘’,(0.,0.,-1.));
#71=DIRECTION(‘’,(0.,0.,1.));
#72=DIRECTION(‘’,(0.,0.,1.));
#73=DIRECTION(‘’,(1.,0.,0.));
#74=DIRECTION(‘’,(0.,0.,1.));
#75=DIRECTION(‘’,(1.,0.,0.));
#76=DIRECTION(‘’,(0.,0.,1.));
#77=DIRECTION(‘’,(1.,0.,0.));
#78=CARTESIAN_POINT(‘’,(0.,0.,0.));
#79=CARTESIAN_POINT(‘’,(0.,0.,30.));
#80=CARTESIAN_POINT(‘’,(-62.5,-62.5,0.));
#81=CARTESIAN_POINT(‘’,(-62.5,-62.5,60.));
#82=CARTESIAN_POINT(‘’,(50.,0.,0.));
#83=CARTESIAN_POINT(‘’,(50.,0.,60.));
#84=CARTESIAN_POINT(‘’,(0.,0.,0.));
#85=CARTESIAN_POINT(‘’,(50.,0.,0.));
#86=CARTESIAN_POINT(‘’,(50.,0.,60.));
#87=CARTESIAN_POINT(‘’,(0.,0.,60.));
#88=CARTESIAN_POINT(‘’,(0.,0.,0.));
ENDSEC;
END-ISO-10303-21;