ODA Drawings SDK allows you to create lofted OdDb3dSolid
objects. 3D solids are objects that can be created as basic primitives, or as extruded, swept, revolved, or lofted profiles.
The lofting functionality is implemented for creating 3D solid objects from a set of curves - cross section curves. There are different parameters which influence the shape of a resulting solid, such as the path curve and the guide curves.
To create a lofted solid you can use the createLoftedSolid()
method. Below, you can find description for each parameter:
crossSectionCurves
is a parameter that represents an input array of section profiles which are used for the creation of a lofted solid;guideCurves
is an optional parameter represents an input array of guide curves which have an influence on the resulting body shape;pPathCurve
is an optional parameter that represents a curve that has an influence on the resulting body shape;loftOptions
is a parameter through which the loft options can be set.There are several properties that can be set to the loft options.
OdDbLoftOptions loftOptions; // loft options
loftOptions.setNormal(OdDbLoftOptions::kNoNormal);
Possible parameter values passed to setNormal
can be found in API Reference.
loftOptions.setNoTwist(true);
Depending on a parameter, it twists or doesn't twist a body.
loftOptions.setClosed()
loftOptions.setSimplify(true)
These options can be used all together or one-by-one, depending on your needs.
There are three possible ways to create a lofted solid and below you can find information on each one.
To perform such operation, use the following method's template:
createLoftedSolid(crossSectionCurves, NULL, NULL, loftOptions);
On the picture below you can see an illustration of how the method works.
To perform such operation, use the following method's template:
createLoftedSolid(crossSectionCurves, NULL, pPathCurve, loftOptions);
On the picture below you can see an illustration of how the method works.
To perform such operation, use the following method's template:
createLoftedSolid(crossSectionCurves, guideCurvesArray, NULL, loftOptions);
On the picture below you can see an illustration of how the method works.
For example, here's a code sample that demonstrates a possible lofted solid creation scenario:
OdDbLoftOptions loftOptions; // loft options
loftOptions.setNormal(OdDbLoftOptions::kNoNormal);
OdDb3dSolidPtr pSolid = OdDb3dSolid::createObject(); // resulting 3D solid
OdDbEntityPtr pPathCurve = pDb->getObject; // get the path curve
OdDbEntityPtrArray crossSectionCurves = pDb->getObjects(); // get the cross-section curves
OdDbEntityPtrArray guideCurvesArray = pDb->getObjects(); // get the guide curves
OdResult res = pSolid->createLoftedSolid(crossSectionCurves, guideCurvesArray, pPathCurve, loftOptions); //create a lofted solid, setting either guideCurvesArray or pPathCurve to NULL.
There is also a command for ExCustObjs sample - createloftedsolid
. It allows you to create lofted solids with parameters:
This functionality is available only in SpaModeler (based on Spatial library).
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|