Functions | |
MSPSOLID_EXPORT StatusInt | mdlSolid_elementToBody (BODY_TAG *bodyP, TransformP bodyTransformP, MSElementDescrP edP, DgnModelRefP modelRef, UInt32 nodeId=1L) |
This function converts an element to a brep which can be a solid (type 19 elements), a sheet (type 18 elements, shapes, bspline surfaces, ellipses etc.) or a wire (curves, line strings etc). More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_elementToBodyList (TAG_ENTITY_LIST **bodyListPP, NON_ENTITY_LIST **templateListPP, NON_ENTITY_LIST **transformListPP, MSElementDescrH remainingEdPP, MSElementDescrP edP, DgnModelRefP modelRef, bool getSolids, bool getSheets) |
Converts a given element into a list of BODY_TAG entities. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_bodyToElement (MSElementDescrH edPP, BODY_TAG bodyTag, bool wireframe, int uIsoParametrics, int vIsoParametrics, unsigned int useSmartIso, MSElementP templateP, DgnModelRefP modelRef) |
Converts a body to a MicroStation element. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_bodyToElements (MSElementDescrH edPP, BODY_TAG bodyTag, bool wireframe, int uIsoParametrics, int vIsoParametrics, unsigned int useSmartIso, MSElementP templateP, DgnModelRefP modelRef) |
Converts a body to MicroStation elements and returns them in an element descriptor chain. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_planarFaceToElement (MSElementDescrH edPP, FACE_TAG face, DgnModelRefP modelRef) |
Creates an equivalent MicroStation element for the input planar face. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_faceToElement (MSElementDescrH edPP, FACE_TAG face, bool wireframe, int nIsoparametrics, MSElementP templateP, DgnModelRefP modelRef) |
Creates an equivalent MicroStation element for the input face. More... | |
MSPSOLID_EXPORT int | mdlSolid_elementFromEdge (MSElementDescrH edPP, MSElementP templateP, EDGE_TAG edge, double *startParameterP, double *endParameterP, DgnModelRefP modelRef) |
Creates an equivalent MicroStation element for the input kernel edge. More... | |
MSPSOLID_EXPORT int | mdlSolid_createChainFromEdgeList (MSElementDescrH outEdPP, TAG_ENTITY_LIST *pEdgeList, MSElementP templateP, DgnModelRefP modelRef) |
Converts the set of edges input into an equivalent MicroStation chain of elements. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_getSurfaceElements (MSElementDescrH outEdPP, MSElementDescrP inEdP, DgnModelRefP modelRef) |
Creates an equivalent surface element for the input element. More... | |
MSPSOLID_EXPORT UInt32 | mdlElmdscr_smartSolidRewrite (MSElementDescrH newEdPP, BODY_TAG newBody, MSElementDescrP oldEdP, BODY_TAG oldBody, UInt32 filePos) |
Rewrites the element descriptor representing the old body with the element descriptor representing the new body using the mdlElmdscr_rewrite function. More... | |
MSPSOLID_EXPORT int | mdlSolid_booleanDisjoint (TAG_ENTITY_LIST *resultBodyListP, BODY_TAG targetBody, TAG_ENTITY_LIST *toolBodyListP, int op) |
Accepts as input a set of bodies and booleans them. More... | |
MSPSOLID_EXPORT int | mdlSolid_unite (BODY_TAG b2, BODY_TAG b1) |
Performs the boolean union operation and leaves the result in b2. More... | |
MSPSOLID_EXPORT int | mdlSolid_subtract (BODY_TAG b2, BODY_TAG b1) |
Subtracts b1 from b2 and leaves the result (possibly consisting of a set of disjoint lumps) in b2. More... | |
MSPSOLID_EXPORT int | mdlSolid_intersect (BODY_TAG b2, BODY_TAG b1) |
Intersects the two input bodies and leaves the result in b2. More... | |
MSPSOLID_EXPORT int | mdlSolid_slice (BODY_TAG *slice, BODY_TAG b1, BODY_TAG b2) |
Intersects the two input bodies and returns the intersection as a wire body. More... | |
MSPSOLID_EXPORT int | mdlSolid_edgeFaceIntersection (TAG_ENTITY_LIST **interEnts, EDGE_TAG e, FACE_TAG f) |
Computes the intersections between the given edge and the given face. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceFaceIntersect (BODY_TAG *b, FACE_TAG f1, FACE_TAG f2) |
Finds the intersect curve between two faces. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_combineBodies (BODY_TAG b1, BODY_TAG b2) |
Combines two possibly disconnected bodies into a single body by moving the lump from one body into the body of the other. More... | |
MSPSOLID_EXPORT int | mdlSolid_debugEntity (ENTITY_TAG entity, WCharCP labelP) |
This function prints diagnostic messages about the entity including its type and data. More... | |
MSPSOLID_EXPORT void | mdlSolid_debugEntitySize (ENTITY_TAG entityIn) |
This function prints diagnostic messages about the entity's size. More... | |
MSPSOLID_EXPORT int | mdlSolid_checkEntity (ENTITY_TAG entityIn) |
Checks the topology and geometry of a given entity and writes the results to the MicroStation text window. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_checkBody (BODY_TAG body, bool checkGeometry, bool checkTopology, bool checkSize) |
Checks the input body for geometric, topological and size validity. More... | |
MSPSOLID_EXPORT int | mdlSolid_addNodeIdAttributes (BODY_TAG body, UInt32 nodeId, int overrideExisting) |
Adds or updates ids to the faces and edges of a body. More... | |
MSPSOLID_EXPORT int | mdlSolid_deleteNodeIdAttributes (BODY_TAG body) |
Removes node Ids and entity Ids from all the faces of a body and edge ids attached to edges of the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_extractId (UInt32 *nodeIdP, UInt32 *entityIdP, ENTITY_TAG entity) |
Extracts the node Id and entity Id from a given entity. More... | |
MSPSOLID_EXPORT int | mdlSolid_idFromEntity (FaceId *faceIdP, ENTITY_TAG ent, bool useHighestId) |
Get the faceID (node-ID, entity-ID) pair of the input entity. More... | |
MSPSOLID_EXPORT int | mdlSolid_idFromFace (FaceId *faceIdP, FACE_TAG face, bool useHighest) |
Get the face id of a face. More... | |
MSPSOLID_EXPORT int | mdlSolid_idFromEdge (EdgeId *edgeIdP, EDGE_TAG edge, bool useHighest) |
Get the edge id of an edge. More... | |
MSPSOLID_EXPORT int | mdlSolid_idFromVertex (VertexId *vertexIdP, VERTEX_TAG vertex, bool useHighest) |
Get the vertex id of a vertex. More... | |
MSPSOLID_EXPORT int | mdlSolid_facesFromId (TAG_ENTITY_LIST *faceListP, FaceId *faceIdP, BODY_TAG body) |
Returns the entity list of faces matching the input face ID. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceFromId (FACE_TAG *faceP, FaceId *faceIdP, BODY_TAG body) |
Finds a face in the input body that has the given face id. More... | |
MSPSOLID_EXPORT int | mdlSolid_edgesFromId (TAG_ENTITY_LIST *edgeListP, EdgeId *edgeIdP, BODY_TAG body) |
Returns the entity list of edges in the input body that have the given edge ID. More... | |
MSPSOLID_EXPORT int | mdlSolid_edgeFromId (EDGE_TAG *edgeP, EdgeId *edgeIdP, BODY_TAG body) |
Finds an edge which has the given edge id. More... | |
MSPSOLID_EXPORT int | mdlSolid_vertexFromId (VERTEX_TAG *vertexP, VertexId *vertexIdP, BODY_TAG body) |
Finds the vertex which has the given vertex id. More... | |
MSPSOLID_EXPORT int | mdlSolid_entityFromId (ENTITY_TAG *entityP, FaceId *entityIdP, int isEdge, BODY_TAG body) |
Finds the entity matching the given face Id. More... | |
MSPSOLID_EXPORT int | mdlSolid_updateBodyNodeId (BODY_TAG body) |
Updates the node ids for the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_lowestUniqueIdFromEdge (EdgeId *edgeIdP, EDGE_TAG edge) |
Returns the lowest edge ID on the edge. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_facetBody (DPoint3d **ppPoints, long *pNumVertice, long **ppFacets, long *pNumFacets, ENTITY_TAG bodyTag, TransformP pTransform, int iMaxSides, double dChordHeight, double dNormalAngle, double dSideWidth) |
This function is used to polygonize (facet) a body. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_facetBodyWithNormals (DPoint3d **ppPoints, long *pNumVertex, long **ppFacetVertex, DPoint3dP *ppNormals, long *pNumNormal, long **ppFacetNormal, long *pNumFacets, ENTITY_TAG bodyTag, TransformP pTransform, int iMaxSides, double dChordHeight, double dNormalAngle, double dSideWidth) |
Polygonize a body allocating memory for the created arrays of vertex points, normals, and facets. More... | |
MSPSOLID_EXPORT void | mdlSolid_freeFacetArray (void *pArray) |
Frees memory associated with the specified facet array. More... | |
MSPSOLID_EXPORT int | mdlSolid_facetToIndices (FacetCallbackFunc funcId, ENTITY_TAG entity, double dNmax, double dmax, double hmax) |
Facets a body and provides the output to the calling application through a callback function. More... | |
MSPSOLID_EXPORT int | mdlSolid_facetBodiesFromEntity (TAG_ENTITY_LIST *pList, ENTITY_TAG entity, TransformP pTransform, double dChordHeight, double dNormalAngle, double dSideWidth, int maxSides) |
Facets a solid or sheet body and returns a list of sheet bodies each of which represents a facet. More... | |
MSPSOLID_EXPORT int | mdlSolid_listCreate (TAG_ENTITY_LIST **lP) |
Creates an empty entity list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listDelete (TAG_ENTITY_LIST **lP) |
Frees the memory allocated for the entity list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listAdd (TAG_ENTITY_LIST *lP, ENTITY_TAG ent) |
Appends an entity to the end of the entity list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listAddList (TAG_ENTITY_LIST *lDP, TAG_ENTITY_LIST *lSP) |
Adds the contents of list lSP to an existing list lDP. More... | |
MSPSOLID_EXPORT int | mdlSolid_listRemove (TAG_ENTITY_LIST *lP, ENTITY_TAG ent) |
Removes an entity from an entity list. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_listRemoveByIndex (TAG_ENTITY_LIST *listP, int index) |
Removes the entry at a supplied index from an entity list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listCount (int *count, TAG_ENTITY_LIST *lP) |
Returns the number of entries in an entity list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listLookup (int *nth, TAG_ENTITY_LIST *lP, ENTITY_TAG ent) |
Searches for a given entity and returns its zero based index in the list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listNthEl (ENTITY_TAG *entP, TAG_ENTITY_LIST *lP, int nth) |
Returns the entity at a given index in an entity list. More... | |
MSPSOLID_EXPORT int | mdlSolid_listEmpty (TAG_ENTITY_LIST *lP) |
Removes all entries from an entity list. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_msBsplineToCurve2d (CURVE_TAG *curveP, MSBsplineCurve *msbCurveP) |
Creates a planar curve in the solid kernel from a b-spline curve definition. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_msBsplineToCurve (CURVE_TAG *curveP, MSBsplineCurve *msbCurveP) |
Creates a curve in the solid kernel from a b-spline curve definition. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_msBsplineToSurface (SURFACE_TAG *surfaceP, MSBsplineSurface *msbSurfP) |
Creates a surface in the solid kernel from a b-spline surface definition. More... | |
MSPSOLID_EXPORT int | mdlSolid_makePrism (BODY_TAG *prismP, double height, double radius, int nSides) |
Creates a solid circular prism of the given height, radius, and number of sides. More... | |
MSPSOLID_EXPORT int | mdlSolid_makeCuboid (BODY_TAG *cuboidP, double dx, double dy, double dz) |
Creates a solid cuboidal (rectangular box) body centered at 0,0,0 and aligned with x, y, z axes. More... | |
MSPSOLID_EXPORT int | mdlSolid_makeCone (BODY_TAG *coneP, double height, double base, double top) |
Creates a solid conical body with the input parameters. More... | |
MSPSOLID_EXPORT int | mdlSolid_makeSphere (BODY_TAG *sphereP, double radius) |
Creates a solid spherical body with the input radius and center at 0,0,0. More... | |
MSPSOLID_EXPORT int | mdlSolid_makeTorus (BODY_TAG *bodyP, double primaryRadius, double secondaryRadius, double angle) |
Creates a solid torus with input major and minor radii. More... | |
MSPSOLID_EXPORT int | mdlSolid_makeWedge (BODY_TAG *bodyP, double radius, double height, double angle) |
Creates a pie-shaped solid (wedge) from the supplied input parameters. More... | |
MSPSOLID_EXPORT int | mdlSolid_makePlane (BODY_TAG *bodyP, DPoint3dP pointP, DPoint3dP normalP, DPoint3dP refDirP, double *intervalP) |
Creates a finite planar rectangular sheet body. More... | |
MSPSOLID_EXPORT int | mdlSolid_makeSheetBody (BODY_TAG *bodyP, SURFACE_TAG surfTag, double *intervalP) |
Given a surface and parameter boundaries, it creates a sheet body representing the surface within the rectangular parametric box. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_makeLineCurve (CURVE_TAG *pCurveTagOut, DPoint3dP pStartPointIn, DPoint3dP pEndPointIn) |
Creates a finite kernel line entity given the start and end points of the line. More... | |
MSPSOLID_EXPORT int | mdlSolid_fixBlends (BODY_TAG *pBody) |
Makes implicit blend attributes on edges and vertices explicit. More... | |
MSPSOLID_EXPORT int | mdlSolid_fixBlendsWithSetback (BODY_TAG *pBody, TAG_ENTITY_LIST *vertexListP, double setback) |
Blends the edges of the specified solid applying the given setback value. More... | |
MSPSOLID_EXPORT void | mdlSolid_removeUnfixedBlends (BODY_TAG body) |
Removes the implicit blend attributes from all edges in the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_setConstantRounds (TAG_ENTITY_LIST *list, double radius, double startSetback, double endSetback) |
Attaches implicit rounds as attributes to each edge in the list. More... | |
MSPSOLID_EXPORT int | mdlSolid_setConstantChamfers (TAG_ENTITY_LIST *list, double leftRange, double rightRange, double startSetback, double endSetback) |
Attaches implicit chamfers as attributes to each edge in the list. More... | |
MSPSOLID_EXPORT int | mdlSolid_offsetFaces (TAG_ENTITY_LIST *pFaceList, double *pOffset, double tolerance, bool faceFaceCheck) |
Offsets an input set of faces by the provided offset distances. More... | |
MSPSOLID_EXPORT int | mdlSolid_hollowBody (BODY_TAG body, TAG_ENTITY_LIST *oldFaceListP, TAG_ENTITY_LIST *newFaceListP, double offset, TAG_ENTITY_LIST *noOffsetFaceListP, TAG_ENTITY_LIST *offsetFaceListP, double *offsetValuesP) |
Offsets faces of the input body by the offset distance provided to created a thin shell body. More... | |
MSPSOLID_EXPORT int | mdlSolid_sweepBodyVector (BODY_TAG body, DPoint3dP directionP, double distance, double shell, double draft) |
Sweeps a wire or sheet body a fixed distance along a vector. More... | |
MSPSOLID_EXPORT int | mdlSolid_sweepBodyAxis (BODY_TAG body, DPoint3dP revolveAxisP, DPoint3dP radialAxisP, double angle, double shell, double draftAngle, bool closeOpenProfiles) |
Revolves a wire or sheet body about the axis passing through the point radialAxisP and along revolveAxisP. More... | |
MSPSOLID_EXPORT int | mdlSolid_sweepBodyWire (BODY_TAG *bodyP, BODY_TAG wireBody, DPoint3d *pathStartP, double shell, bool capped, DgnModelRefP modelRef) |
Sweeps an input wire or sheet body along a path represented by wireBodyP. More... | |
MSPSOLID_EXPORT int | mdlSolid_sweepFaces (TAG_ENTITY_LIST *faceListP, DPoint3dP translationP, bool faceFaceCheck) |
Sweeps the set of faces belonging to the same body by the input translation vector. More... | |
MSPSOLID_EXPORT int | mdlSolid_spinFaces (TAG_ENTITY_LIST *faceListP, DPoint3dP originP, DPoint3dP axisP, double angle, bool faceFaceCheck) |
Spins one or more faces belonging to the same solid body around the input axis. More... | |
MSPSOLID_EXPORT int | mdlSolid_thickenSheetBody (BODY_TAG body, TAG_ENTITY_LIST *oldFaceListP, TAG_ENTITY_LIST *newFaceListP, double forwardDist, double backwardDist) |
Thickens the input sheet body into a solid body. More... | |
MSPSOLID_EXPORT int | mdlSolid_offsetWire (TAG_ENTITY_LIST *pOffsetList, BODY_TAG wireBody, EDGE_TAG refEdge, DPoint3d *pNormal, double distance, double tolerance, int gapFill, bool localCheck) |
Returns a list of edges that are the offset edges of the input wire body. More... | |
MSPSOLID_EXPORT bool | mdlSolid_ambiguousBoresite (BODY_TAG body, DgnModelRefP modelRef, DPoint3d *pointP, int view) |
Determines whether the input point in the given view locates a body. More... | |
MSPSOLID_EXPORT void | mdlSolid_getBoresiteFromACS (DPoint3dP borePointP, DPoint3dP boreDirectionP, DPoint3dCP pointP, int view, DgnModelRefP modelRef, bool useACS, bool frontClipBorePoint) |
Returns a bore point and bore direction from the input point, view and ACS. More... | |
MSPSOLID_EXPORT void | mdlSolid_getBoresite (DPoint3d *borePointP, DPoint3d *boreDirectionP, DPoint3d *pointP, int view, DgnModelRefP modelRef) |
Takes the input point pointP in the view specified by view, and returns the boresite point and boresite direction in solid kernel units. More... | |
MSPSOLID_EXPORT void | mdlSolid_getLocateBoresite (DPoint3d *borePointP, DPoint3d *boreDirectionP, double *radiusP, DgnModelRefP modelRef) |
Returns a bore point and bore direction from the locate point. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_findClosestPointOnBody (DPoint3dP pPointOut, ENTITY_TAG *pEntityOut, double *pDistance, BODY_TAG bodyTagIn, TransformP pTransformIn, DPoint3dP pPointIn) |
Finds the closest point and the closest entity on the body from the input test point (pPointIn). More... | |
MSPSOLID_EXPORT int | mdlSolid_closestPointOnBody (DPoint3dP pointOutP, ENTITY_TAG *entityOutP, double *distanceP, BODY_TAG body, TransformP transP, DPoint3dP pointP, DgnModelRefP modelRef) |
Computes the closest point on the body and the entity on the body this point lies on. More... | |
MSPSOLID_EXPORT int | mdlSolid_closestPointToFace (DPoint3d *clstPt, DPoint3d *normal, DPoint2d *param, DPoint3d *testPt, FACE_TAG face) |
Computes the closest point on the input face to a input point. More... | |
MSPSOLID_EXPORT int | mdlSolid_closestPointToEdge (DPoint3d *clstPt, double *param, DPoint3d *testPt, EDGE_TAG edge) |
Computes the closest point to an edge from a given point. More... | |
MSPSOLID_EXPORT int | mdlSolid_closestPointToSurface (DPoint3d *clstPt, DPoint3d *normal, DPoint2d *param, DPoint3d *testPt, FACE_TAG face) |
Computes the closest point to the input test point on the input face. More... | |
MSPSOLID_EXPORT int | mdlSolid_closestPointToCurve (DPoint3d *clstPt, double *param, DPoint3d *testPt, EDGE_TAG edge) |
Computes the closest point to the input test point on the input edge. More... | |
MSPSOLID_EXPORT int | mdlSolid_pointFromVertex (DPoint3d *point, VERTEX_TAG vertex) |
Returns the global coordinates of the point underlying the vertex. More... | |
MSPSOLID_EXPORT bool | mdlSolid_locateBodyList (FACE_TAG *faceP, EDGE_TAG *edgeP, DPoint3dP outPointP, int *bodyIndexP, TAG_ENTITY_LIST *bodyListP, NON_ENTITY_LIST *transformListP, DPoint3dP inPointP, double locateTolerance, int view, DgnModelRefP modelRef) |
Given a datapoint and a view, this function can be used to get the closest face and edge among a list of bodies. More... | |
MSPSOLID_EXPORT int | mdlSolid_getEntities (TAG_ENTITY_LIST *hits, double **params, DPoint3dP origin, DPoint3dP dir, double radius, int type, BODY_TAG b, DgnModelRefP modelRef) |
Fires an infinite length ray of radius 'radius' from the input starting point, along the ray direction and returns the entities on the input body that the ray intersects with. More... | |
MSPSOLID_EXPORT int | mdlSolid_rayTestBody (ENTITY_TAG **entities, double **params, int *hitsFound, DPoint3d *origin, DPoint3d *dir, BODY_TAG b, int hitsWanted, bool backupRayOrigin, DgnModelRefP modelRef) |
Fires a ray from origin along dir and finds all entities in the input body that intersect with the ray. More... | |
MSPSOLID_EXPORT int | mdlSolid_rayTestFace (DPoint3dP *pointPP, DPoint2d **uvPP, double **rayParamPP, int *hitsFoundP, DPoint3dCP originP, DVec3dCP dirP, FACE_TAG face, double minRayDistance, double maxRayDistance) |
Fires a ray from origin and along dir and the points of intersection between the ray and the face. More... | |
MSPSOLID_EXPORT int | mdlSolid_boresiteToFace (DPoint3d *outPointP, DPoint3d *outNormalP, FACE_TAG *outFaceP, DPoint3d *inPointP, DPoint3d *inNormalP, BODY_TAG body, bool backupRayOrigin, DgnModelRefP modelRef) |
Fires a ray from inPointP along inNormalP at the input body and returns the first face it hits as well as the intersection point and the normal direction of the face at this point. More... | |
MSPSOLID_EXPORT int | mdlSolid_boresiteToEdge (DPoint3d *outPointP, EDGE_TAG *outEdgeP, DPoint3d *inPointP, DPoint3d *inNormalP, BODY_TAG body, bool backupRayOrigin, DgnModelRefP modelRef) |
Fires a ray from inPointP along inNormalP at the input body and returns the first edge it hits as well as the intersection point. More... | |
MSPSOLID_EXPORT int | mdlSolid_boresiteToVertex (DPoint3d *outPointP, VERTEX_TAG *outVertexP, DPoint3d *inPointP, DPoint3d *inNormalP, BODY_TAG body, bool backupRayOrigin, DgnModelRefP modelRef) |
Fires a ray from inPointP along inNormalP at the input body and returns the first vertex it hits as well as the intersection point. More... | |
MSPSOLID_EXPORT int | mdlSolid_boresiteFaceByEdge (FACE_TAG *pFace, FACE_TAG *pFace1, FACE_TAG *pFace2, int *pHitStatus, DPoint3d *pBorePt, DPoint3d *pBoreDir, BODY_TAG body, DgnModelRefP modelRef) |
This function tries to get the face at the boresite by first getting the edge near the boresite and then extracting the faces adjacent to the edge that is gotten. More... | |
MSPSOLID_EXPORT int | mdlSolid_pointInBody (int *inBody, DPoint3d *loc, BODY_TAG body) |
The mdlSolid_pointInBody function tests whether a point lies inside, outside or on the boundary of a given body. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceIntersectLine (DPoint3dP *pointPP, DPoint2d **uvPP, double **rayParamPP, int *hitsFoundP, DPoint3d *originP, DPoint3d *dirP, FACE_TAG face, BODY_TAG body) |
Fires a ray from the origin, originP, along the direction, dirP, towards the face, faceP, of the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceIntersectCurve (DPoint3dP *pointPP, DPoint2d **faceUVPP, double **curveParamPP, int *numIntsP, FACE_TAG face, CURVE_TAG curve, double startParam, double endParam) |
Intersects the portion of the given curve between startParam and endParam with the given face, and returns the absolute points of intersection between the curve and face, the surface parameters at the points of intersection, and the curve parameters at the points of intersection. More... | |
MSPSOLID_EXPORT int | mdlSolid_getEntityBox (DPoint3d *lo, DPoint3d *hi, ENTITY_TAG en) |
Computes the bounding box of an entity. More... | |
MSPSOLID_EXPORT int | mdlSolid_getBodyBox (DPoint3d *lo, DPoint3d *hi, BODY_TAG b) |
Computes the bounding box of a body. More... | |
MSPSOLID_EXPORT int | mdlSolid_loopExternal (int *isExternal, LOOP_TAG l) |
Determines if a loop is an internal or external loop of a face. More... | |
MSPSOLID_EXPORT void | mdlSolid_getNewSharedEdges (TAG_ENTITY_LIST *listP, BODY_TAG body) |
Returns a list of edges that are newly created and have no node ids attached. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSmoothEdge (EDGE_TAG edge) |
Checks whether the two adjacent faces of the given edge are connected with tangent continuity. More... | |
MSPSOLID_EXPORT void | mdlSolid_getSmoothFaceList (TAG_ENTITY_LIST *listP, FACE_TAG face, bool addSmoothFaces, int allowedFaceTypeMask) |
This function adds a face to the list of faces, and also adds a face smoothly connected to the faces in the list. More... | |
MSPSOLID_EXPORT void | mdlSolid_getSmoothEdgeList (TAG_ENTITY_LIST *listP, FACE_TAG edge, SmoothEdgeType smoothEdges) |
This function adds an edge to a list of edges. More... | |
MSPSOLID_EXPORT int | mdlSolid_getEdgeListFromFace (TAG_ENTITY_LIST *edgeListP, FACE_TAG face) |
Returns all the edges that make up the loops of the face. More... | |
MSPSOLID_EXPORT int | mdlSolid_getVertexListFromFace (TAG_ENTITY_LIST *vertexListP, FACE_TAG face) |
Returns all the vertices that belong to a face. More... | |
MSPSOLID_EXPORT int | mdlSolid_wireIsG1 (BODY_TAG wire) |
This function determines whether the input wire body is G1 continuous (smooth) across all of its vertices. More... | |
MSPSOLID_EXPORT int | mdlSolid_edgeCurveLength (double *length, double startParam, double endParam, EDGE_TAG edge) |
Computes the length (in solids kernel units) of the edge between the startParam and endParam parameters. More... | |
MSPSOLID_EXPORT int | mdlSolid_bodyMassProperties (double *pVolumeOut, double *pPeripheryOut, DPoint3d *pCentroidOut, double inertiaOut[3][3], BODY_TAG bodyIn, TransformP transformP, double requiredToleranceIn) |
Calculates the volume, center of gravity and moments of inertia of a body. More... | |
MSPSOLID_EXPORT int | mdlSolid_entityArea (double *area, double *achTol, ENTITY_TAG ent, double reqTol) |
Calculates the surface area of a face, sheet body, or two-dimensional general body. More... | |
MSPSOLID_EXPORT int | mdlSolid_minimumDistanceBetweenEntities (DPoint3dP pPoint1, DPoint3dP pPoint2, double *pDistance, ENTITY_TAG entity1, ENTITY_TAG entity2) |
Compute minimum distance between two entities. More... | |
MSPSOLID_EXPORT int | mdlSolid_transformFromSurfaceUV (TransformP transformP, TransformP inverseTransformP, FACE_TAG face, DPoint2d *uvP, DgnModelRefP modelRef) |
Creates a transformation matrix from a point on the given face. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_simplifyBody (BODY_TAG *bodyP, bool local) |
Attempts to simplify bspline curves and surfaces into analytic curves and surfaces wherever possible. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_imprintCurveNormal (TAG_ENTITY_LIST *pImprintList, BODY_TAG body, TAG_ENTITY_LIST *pEdgeList, double tolerance) |
This function takes as input a body and a list of edges and tries to imprint the edges on to the body. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_imprintCurveVector (TAG_ENTITY_LIST *pImprintList, BODY_TAG body, TAG_ENTITY_LIST *pEdgeList, DPoint3d *pVector, double tolerance) |
This function is similar to the mdlSolid_imprintCurveNormal except that instead of projecting curves along face normals, it takes an explicit vector along which the curves are projected. More... | |
MSPSOLID_EXPORT double | mdlSolid_getParasolidScale (DgnModelRefP modelRef) |
Returns the scale factor to convert from solid modeling kernel units to Units of Resolution(UORs). More... | |
MSPSOLID_EXPORT void | mdlSolid_beginCurrTrans (DgnModelRefP modelRef) |
Pushes a transformation matrix which converts solid modeling kernel units to Units of Resolution onto the stack. More... | |
MSPSOLID_EXPORT void | mdlSolid_endCurrTrans () |
This function pops the transform pushed by mdlSolid_beginCurrTrans. More... | |
MSPSOLID_EXPORT double | mdlSolid_samePointTolerance () |
Returns the tolerance set within a .dgn file that determines whether two points are the same (i.e. More... | |
MSPSOLID_EXPORT int | mdlSolid_applyTransform (ENTITY_TAG entity, TransformP transformP) |
Transforms the input entity by the input transformation matrix. More... | |
MSPSOLID_EXPORT int | mdlSolid_capSurface (TAG_ENTITY_LIST *faces, BODY_TAG *lamina) |
Converts a sheet body to a solid by adding faces to fill up "hollow spaces." Example of an application of this function is when you have sheet body in the shape of cube but with one face missing, then you can use this function to cap the sheet body and convert it into a solid body. More... | |
MSPSOLID_EXPORT int | mdlSolid_coverWires (TAG_ENTITY_LIST *faceList, BODY_TAG wires) |
Covers the input wire body by creating faces out of closed edges and then fitting the faces with appropriate surfaces. More... | |
MSPSOLID_EXPORT int | mdlSolid_reverseBody (BODY_TAG body) |
Reverses the orientations all faces of the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_regulariseEntity (ENTITY_TAG entity) |
The mdlSolid_regulariseEntity function removes all faces, edges and vertices which are unnecessary for supporting the topology of the given entity. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_sewBodies (TAG_ENTITY_LIST *sewnBodyListP, TAG_ENTITY_LIST *unsewnBodyListP, TAG_ENTITY_LIST *inputBodyListP, double gapTolerance) |
This function sews or stitches a list of sheet bodies and returns two sets of bodies. More... | |
MSPSOLID_EXPORT int | mdlSolid_sewBodiesRecursively (TAG_ENTITY_LIST *sheetBodyListP, double minTol, double maxTol, double mulTol) |
The function accepts a list of sheet bodies as input and tries to stitch them all together into one are more bodies. More... | |
MSPSOLID_EXPORT int | mdlSolid_recursiveSewSheetsToElement (MSElementDescrH ppEdP, TAG_ENTITY_LIST *pSheetList, MSElementP templateP, DgnModelRefP modelRef, double maxTol) |
The function takes as input a list of sheet bodies and tries to stitch them into a single sheet body. More... | |
MSPSOLID_EXPORT int | mdlSolid_copyEntity (ENTITY_TAG *copy, ENTITY_TAG source) |
Copies an entity and all the entities below it to a newly created entity. More... | |
MSPSOLID_EXPORT int | mdlSolid_deleteEntity (ENTITY_TAG e) |
Deletes the given entity and frees the memory allocated for it. More... | |
MSPSOLID_EXPORT int | mdlSolid_copyBody (BODY_TAG *copy, BODY_TAG source) |
Make a copy of a body. More... | |
MSPSOLID_EXPORT void | mdlSolid_freeBody (BODY_TAG body) |
Frees the memory allocated for the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_free (void *v) |
Frees memory allocated by the solid kernel when the results are returned as arrays. More... | |
MSPSOLID_EXPORT int | mdlSolid_evaluateEdge (DPoint3d *pointP, DPoint3d *duP, DPoint3d *duuP, DPoint3d *tangentP, DPoint3d *normalP, DPoint3d *binormalP, double u, EDGE_TAG edge) |
Evaluates an edge at the input parameter and computes the point, the first derivative, second derivative, tangent vector, main normal vector and binormal vector of an edge at that parameter. More... | |
MSPSOLID_EXPORT int | mdlSolid_evaluateFace (DPoint3d *pointP, DPoint3d *normalP, DPoint3d *duP, DPoint3d *dvP, DPoint3d *duuP, DPoint3d *duvP, DPoint3d *dvvP, double u, double v, FACE_TAG face) |
Evaluates the face (or the surface underlying the face) at the input parameter and returns the point, surface normal direction, first partial derivatives, second partial derivatives and mixed partial derivative of the face at the given parameter. More... | |
MSPSOLID_EXPORT int | mdlSolid_bodyData (WIRE_TAG *wire, LUMP_TAG *lump, void **transfPP, BODY_TAG b) |
The mdlSolid_bodyData function returns the first wire in the case of wire bodies and the first lump in the case of solid, sheet and general bodies. More... | |
MSPSOLID_EXPORT int | mdlSolid_planarFaceData (DPoint3d *rootPointP, DPoint3d *normalP, FACE_TAG face) |
Finds a point on the face and computes the normal direction of the face. More... | |
MSPSOLID_EXPORT int | mdlSolid_lumpData (SHELL_TAG *shell, LUMP_TAG *next, LUMP_TAG l) |
Returns the first shell data and the next lump pointed to by the given lump. More... | |
MSPSOLID_EXPORT int | mdlSolid_shellData (FACE_TAG *face, SHELL_TAG *next, SHELL_TAG s) |
Returns the first face of the input shell and the next shell in the lump or NULL if this is the last shell in the lump. More... | |
MSPSOLID_EXPORT int | mdlSolid_vertexData (DPoint3d *pointP, VERTEX_TAG vertex) |
Extracts the underlying point from a vertex. More... | |
MSPSOLID_EXPORT int | mdlSolid_edgeData (VERTEX_TAG *startVertexP, VERTEX_TAG *endVertexP, DPoint3d *startPointP, DPoint3d *endPointP, double *startParamP, double *endParamP, COEDGE_TAG *coEdgeP, CURVE_TAG *curveP, bool *reversedP, EDGE_TAG edge) |
Returns topological and geometric information about the edge. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceData (LOOP_TAG *loop, FACE_TAG *next, SURFACE_TAG *surfaceP, bool *reversedP, bool *doubleSidedP, FACE_TAG f) |
Returns the first loop in the input face, the next face in the body, the surface underlying the face and sense information for the face. More... | |
MSPSOLID_EXPORT int | mdlSolid_loopData (FACE_TAG *face, COEDGE_TAG *coedge, LOOP_TAG *next, LOOP_TAG l) |
Returns the face containing the loop, the first coedge in the loop, and the next loop in the face. More... | |
MSPSOLID_EXPORT int | mdlSolid_coedgeData (EDGE_TAG *edge, ENTITY_TAG *owner, COEDGE_TAG *partner, COEDGE_TAG *next, COEDGE_TAG *prev, DPoint3d *start, DPoint3d *end, bool *reversed, COEDGE_TAG coedge) |
Returns topological and geometry information about the loop. More... | |
MSPSOLID_EXPORT int | mdlSolid_coedgesFromEdge (COEDGE_TAG *coedge1P, COEDGE_TAG *coedge2P, EDGE_TAG edge) |
Returns all the coedge(s) that reference the input edge. More... | |
MSPSOLID_EXPORT int | mdlSolid_loopFromCoedge (LOOP_TAG *loopP, COEDGE_TAG coedge) |
Returns the loop that owns the coedge. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceFromLoop (FACE_TAG *faceP, LOOP_TAG loop) |
Returns the face that owns the input loop. More... | |
MSPSOLID_EXPORT int | mdlSolid_facesFromEdge (FACE_TAG *face1P, FACE_TAG *face2P, EDGE_TAG edge) |
Returns the faces that intersect at the input edge. More... | |
MSPSOLID_EXPORT void | mdlSolid_getVertexList (TAG_ENTITY_LIST *listP, BODY_TAG body) |
Returns all vertices of a body. More... | |
MSPSOLID_EXPORT void | mdlSolid_getEdgeList (TAG_ENTITY_LIST *listP, BODY_TAG body) |
Returns all edges of the body. More... | |
MSPSOLID_EXPORT void | mdlSolid_getFaceList (TAG_ENTITY_LIST *listP, BODY_TAG body) |
Returns all faces in the body. More... | |
MSPSOLID_EXPORT void | mdlSolid_getCoEdgeList (TAG_ENTITY_LIST *listP, BODY_TAG body) |
Returns all coedges of a body. More... | |
MSPSOLID_EXPORT void | mdlSolid_getLoopList (TAG_ENTITY_LIST *listP, BODY_TAG body) |
Returns all loops in the body. More... | |
MSPSOLID_EXPORT int | mdlSolid_bodyAskFirstEdge (EDGE_TAG *pEdge, BODY_TAG body) |
Returns the first edge of a body. More... | |
MSPSOLID_EXPORT int | mdlSolid_body (BODY_TAG *b) |
Creates an empty minimal body. More... | |
MSPSOLID_EXPORT int | mdlSolid_sheetFromFaces (BODY_TAG *sheetP, TAG_ENTITY_LIST *faceListP) |
Creates a sheet body by joining together the input faces. More... | |
MSPSOLID_EXPORT int | mdlSolid_sheetFromFace (BODY_TAG *sheetP, FACE_TAG face) |
Creates a sheet body from a single face. More... | |
MSPSOLID_EXPORT int | mdlSolid_removeFace (FACE_TAG f) |
The mdlSolid_removeFace function removes a face from its owning body. More... | |
MSPSOLID_EXPORT int | mdlSolid_removeFaces2 (TAG_ENTITY_LIST *bodyListP, TAG_ENTITY_LIST *faceListP, int healOption, bool healLoop) |
Removes the set of input faces from their owning body. More... | |
MSPSOLID_EXPORT int | mdlSolid_uncoverFace (FACE_TAG face) |
Removes a face from it's owning sheet body. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_trimByEdgesAndFaces (BODY_TAG body, TAG_ENTITY_LIST *pEdgeList, TAG_ENTITY_LIST *pFaceList, bool keep) |
This function trims a sheet body using a set of supplied edges. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_imprintBodies (TAG_ENTITY_LIST *pTargetEdges, TAG_ENTITY_LIST *pToolEdges, BODY_TAG target, BODY_TAG tool, double tolerance, bool imprintTool) |
Intersects the two input bodies and imprints their intersection on one, or both, by adding new edges and faces. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSmartSolidElement (MSElementDescrP edP, DgnModelRefP modelRef) |
Determines whether the input element is a smartsolid element. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSmartSheetElement (MSElementDescrP edP, DgnModelRefP modelRef) |
Determines whether the input element is a smartsheet element. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSmartElement (MSElementDescrP edP, DgnModelRefP modelRef) |
Determines whether the input element is a smartsolid or smartsheet. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSolidElement (MSElementDescrP edP, DgnModelRefP modelRef) |
Determines whether the input element is a solid element. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSheetElement (MSElementDescrP edP, DgnModelRefP modelRef) |
Determines whether the input element is an element that can be represented as a sheet body. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSheetOrSolidElement (MSElementDescrP edP, DgnModelRefP modelRef) |
Determines whether the input element is a sheet or solid element. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isModelerElement (MSElementDescrP edP) |
Tests whether the element is a modeler element (has a node linkage attached to it) More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSheetBody (BODY_TAG bodyTag) |
Determines whether the input body is a sheet body. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isSolidBody (BODY_TAG bodyTag) |
Determines whether the input body is a solid body. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isWireBody (BODY_TAG bodyTag) |
This function determines whether the input body is a wire body. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isAnalyticBody (BODY_TAG bodyTag) |
Determines whether the surfaces underlying the faces in a body are analytic (non b-spline) surfaces. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isGeneralBody (BODY_TAG bodyTag) |
This function determines whether the input body is a general (non-manifold) body. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isMinimalBody (BODY_TAG bodyTag) |
Tests whether the given body is the simplest type of manifold body, a minimum (or minimal) body, sometimes called an "acorn". More... | |
MSPSOLID_EXPORT int | mdlSolid_getFaceType (FACE_TAG faceTag) |
This function returns the type of the given face. More... | |
MSPSOLID_EXPORT int | mdlSolid_getEdgeType (EDGE_TAG edgeTag) |
This function returns the type of the given edge entity. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isBody (ENTITY_TAG entityTag) |
Checks whether input entity is a body or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isLump (ENTITY_TAG entityTag) |
Checks if the input entity is a lump or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isShell (ENTITY_TAG entityTag) |
Checks if entity is SHELL or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isFace (ENTITY_TAG entityTag) |
Checks if entity is FACE or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isLoop (ENTITY_TAG entityTag) |
Checks if input entity is loop or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isCoEdge (ENTITY_TAG entityTag) |
Checks if input entity is COEDGE or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isEdge (ENTITY_TAG entityTag) |
Checks if input entity is EDGE or not. More... | |
MSPSOLID_EXPORT bool | mdlSolid_isVertex (ENTITY_TAG entityTag) |
Tests whether input entity is vertex or not. More... | |
MSPSOLID_EXPORT int | mdlSolid_bodyType () |
Returns the BODY_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_wireType () |
Returns the WIRE_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_lumpType () |
Returns the LUMP_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_shellType () |
Returns the SHELL_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_subShellType () |
Returns the SUBSHELL_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_faceType () |
Returns the FACE_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_loopType () |
Returns the LOOP_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_coedgeType () |
Returns the COEDGE_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_edgeType () |
Returns the EDGE_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT int | mdlSolid_vertexType () |
Returns the BODY_TYPE constant that can be used as input to many functions. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_removeBlends (double blendRadius, BODY_TAG bodyTag) |
The mdlSolid_removeBlends function removes blend faces from its owning body. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_removeHoles (double holeRadius, BODY_TAG bodyTag) |
The mdlSolid_removeHoles function removes holes from its owning body. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_removeTinyFaces (double tinyArea, BODY_TAG bodyTag) |
The mdlSolid_removeTinyFaces function removes tiny faces from its owning body. More... | |
MSPSOLID_EXPORT StatusInt | mdlSolid_removeFeatures (double blendRadius, double holeRadius, double tinyArea, BODY_TAG bodyTag) |
The mdlSolid_removeFeatures function removes small features from its owning body. More... | |
MSPSOLID_EXPORT UInt32 mdlElmdscr_smartSolidRewrite | ( | MSElementDescrH | newEdPP, |
BODY_TAG | newBody, | ||
MSElementDescrP | oldEdP, | ||
BODY_TAG | oldBody, | ||
UInt32 | filePos | ||
) |
Rewrites the element descriptor representing the old body with the element descriptor representing the new body using the mdlElmdscr_rewrite function.
In addition, it also transfers the wireframe tags from the old element descriptor to the new one. Associative dimensions are transferred from the oldbody to the new body. This function should be used when the brep underlying a smart element is modified and element created from the resultant brep is written back to the file replacing the old element.
[in,out] | newEdPP | the element descriptor representing the modified brep. This also gets the wireframe tags and associations from the old element |
[in] | newBody | the new body after modification |
[in] | oldEdP | the element descriptor for the original body element |
[in] | oldBody | the original body before modification |
[in] | filePos | the original file position of the old element |
MSPSOLID_EXPORT int mdlSolid_addNodeIdAttributes | ( | BODY_TAG | body, |
UInt32 | nodeId, | ||
int | overrideExisting | ||
) |
Adds or updates ids to the faces and edges of a body.
Each face is given a nodeId and an entityId. The nodeId represents an integer value > 0 that indicates the operation that created the face. The entityId differentiates the face among all the faces that were created during that operation. Consider the following example: A solid with six faces is created in MicroStation. When a solid operation (a blend) is attempted on the cube, the type 19 element is converted to a SmartSolid cell. This operation attaches face ids for the six faces. While all the six faces get a node id of 1, each face will get a unique entityid between 1 & 6 if this function is used to add the node ids Edge ids are also attached to the body. An Edge id consists of the face ids of the two faces adjacent to it.
[in] | body | is the given body. |
[in] | nodeId | is the node Id. |
[in] | overrideExisting | true if override existing node Id. |
MSPSOLID_EXPORT bool mdlSolid_ambiguousBoresite | ( | BODY_TAG | body, |
DgnModelRefP | modelRef, | ||
DPoint3d * | pointP, | ||
int | view | ||
) |
Determines whether the input point in the given view locates a body.
The function works in two steps. First, the input pointP and view is used to calculate a bore site and a bore direction in solid kernel units using the mdlSolid_getBoresite function. Then, a ray is fired from the boresite along bore direction onto the input body. If the ray intersects the body, then this function returns TRUE and FALSE otherwise.
[in] | body | the body to test |
[in] | modelRef | the model containing the body element |
[in] | pointP | boresite point |
[in] | view | the view to test |
MSPSOLID_EXPORT int mdlSolid_applyTransform | ( | ENTITY_TAG | entity, |
TransformP | transformP | ||
) |
Transforms the input entity by the input transformation matrix.
The transformation matrix can have translational, scaling and rotational components but not shear components. Transforming a entity changes the geometry underlying the topology of the entity. Care must be taken when scaling bodies. A large scale factor applied to a entity can cause the entity to become invalid thereby causing downstream modeling operations to fail.
[in,out] | entity | is the input entity. |
[in] | transformP | is the transformation matrix. |
MSPSOLID_EXPORT void mdlSolid_beginCurrTrans | ( | DgnModelRefP | modelRef | ) |
Pushes a transformation matrix which converts solid
modeling kernel units to Units of Resolution onto the stack.
For each call to this function there should always be a call to mdlSolid_endCurrTrans to pop the transfomation matrix from the stack. Using this function, it becomes easier to convert between MicroStation elements and solid modeling kernel entities.
[in] | modelRef | input model ref for which solid modeling transformation needs to be pushed on to the stack |
MSPSOLID_EXPORT int mdlSolid_body | ( | BODY_TAG * | b | ) |
Creates an empty minimal body.
A minimum body is a zero dimensional body that contains only a single vertex. It is also called an acorn. A typical example of its application is when a wire body is build through scribing of curves. Consider four trimmed lines in the form of a square that need to go into a wire body. In such cases, an acorn is frist created and then the lines segments are scribed onto the acorn to create the wire body.
[in,out] | b | is the body created. |
MSPSOLID_EXPORT int mdlSolid_bodyAskFirstEdge | ( | EDGE_TAG * | pEdge, |
BODY_TAG | body | ||
) |
Returns the first edge of a body.
[out] | pEdge | is the first edge of the body. |
[in] | body | is the input body |
MSPSOLID_EXPORT int mdlSolid_bodyData | ( | WIRE_TAG * | wire, |
LUMP_TAG * | lump, | ||
void ** | transfPP, | ||
BODY_TAG | b | ||
) |
The mdlSolid_bodyData function returns the first wire in the
case of wire bodies and the first lump in the case of solid, sheet and general bodies.
It also returns the transformation matrix stored with the body.
[out] | wire | is the first wire or NULL. |
[out] | lump | is the first lump or NULL. |
[out] | transfPP | is the transformation or NULL (identity transformation). |
[in] | b | is the input body. |
MSPSOLID_EXPORT int mdlSolid_bodyMassProperties | ( | double * | pVolumeOut, |
double * | pPeripheryOut, | ||
DPoint3d * | pCentroidOut, | ||
double | inertiaOut[3][3], | ||
BODY_TAG | bodyIn, | ||
TransformP | transformP, | ||
double | requiredToleranceIn | ||
) |
Calculates the volume, center of gravity and moments of inertia
of a body.
The major diagonal of the inertia tensor returned contains values for the inertias about each axis relative to (0, 0, 0) in the world coordinate system.
[out] | pVolumeOut | is the volume of the body in the case of solid bodies and three-dimensional general bodies. It returns the surface area in case of sheet bodies. It returns the length in case of wire bodies. |
[out] | pPeripheryOut | body's periphery value. It returns the surface area in case of solid bodies and three-dimensional general bodies. It returns the circumference in case of sheet bodies. It is not used in case of wire bodies. |
[out] | pCentroidOut | is the centroid of the body. |
[out] | inertiaOut | is the inertia matrix. |
[in] | bodyIn | is the given body. |
[in] | transformP | trasnform to apply before calculating mass properties |
[in] | requiredToleranceIn | tolerance within which the above properties are calculated. |
MSPSOLID_EXPORT StatusInt mdlSolid_bodyToElement | ( | MSElementDescrH | edPP, |
BODY_TAG | bodyTag, | ||
bool | wireframe, | ||
int | uIsoParametrics, | ||
int | vIsoParametrics, | ||
unsigned int | useSmartIso, | ||
MSElementP | templateP, | ||
DgnModelRefP | modelRef | ||
) |
Converts a body to a MicroStation element.
A solid body will return a single SmartSolid, a cell element with the name (Smart Solid). A sheet body may return a SmartSheet, a cell element with the name (Smart Surface) or when it can be represented more simply, a shape, complex shape or bspline surface element. The SmartSolid or SmartSheet cell has dgn store components that hold the actual brep data. The brep data is used in modeling operations; the converted graphic elements are used for wireframe display purposes only.
[out] | edPP | is the single (cell) element |
[in] | bodyTag | is the body to be converted |
[in] | wireframe | set true for edge geometry representation (preferred), or false for a surface representation. |
[in] | uIsoParametrics | is the number of u isoparametrics. (-1 for active settings) |
[in] | vIsoParametrics | is the number of v isoparametrics. (-1 for active settings) |
[in] | useSmartIso | flags controlling smart iso calculation for certain faces, usually SMART_ISO_Auto. (see msbrepcommon.r.h) |
[in] | templateP | is a symbology template for the element descriptor. |
[in] | modelRef | indicates the model containing the body to convert. |
MSPSOLID_EXPORT StatusInt mdlSolid_bodyToElements | ( | MSElementDescrH | edPP, |
BODY_TAG | bodyTag, | ||
bool | wireframe, | ||
int | uIsoParametrics, | ||
int | vIsoParametrics, | ||
unsigned int | useSmartIso, | ||
MSElementP | templateP, | ||
DgnModelRefP | modelRef | ||
) |
Converts a body to MicroStation elements and returns them in an element descriptor chain.
[out] | edPP | is the element descriptor chain. |
[in] | bodyTag | is the body to be converted |
[in] | wireframe | set true for edge geometry representation (preferred), or false for a surface representation. |
[in] | uIsoParametrics | is the number of u isoparametrics. (-1 for active settings) |
[in] | vIsoParametrics | is the number of v isoparametrics. (-1 for active settings) |
[in] | useSmartIso | flags controlling smart iso calculation for certain faces, usually SMART_ISO_Auto. (see msbrepcommon.r.h) |
[in] | templateP | is a symbology template for the element descriptor. |
[in] | modelRef | indicates the model containing the body to convert. |
MSPSOLID_EXPORT int mdlSolid_bodyType | ( | ) |
Returns the BODY_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT int mdlSolid_booleanDisjoint | ( | TAG_ENTITY_LIST * | resultBodyListP, |
BODY_TAG | targetBody, | ||
TAG_ENTITY_LIST * | toolBodyListP, | ||
int | op | ||
) |
Accepts as input a set of bodies and booleans them.
Unlike the other boolen functions (ex. mdlSolid_unite), it produces a set of disjoint bodies rather than a single body with multiple lumps (see LUMP_TAG).
[out] | resultBodyListP | output list of disjoint bodies |
[in] | targetBody | target body to boolean the tool bodies with |
[in] | toolBodyListP | tool bodies to boolean with target body |
[in] | op | boolean operation. This can be one of MODELER_BOOLEAN_unite - Unites tool bodies with target body MODELER_BOOLEAN_intersect - Intersects target and tool bodies MODELER_BOOLEAN_difference - Subtracts tool bodies from target body |
MSPSOLID_EXPORT int mdlSolid_boresiteFaceByEdge | ( | FACE_TAG * | pFace, |
FACE_TAG * | pFace1, | ||
FACE_TAG * | pFace2, | ||
int * | pHitStatus, | ||
DPoint3d * | pBorePt, | ||
DPoint3d * | pBoreDir, | ||
BODY_TAG | body, | ||
DgnModelRefP | modelRef | ||
) |
This function tries to get the face at the boresite by first getting the edge near the boresite and then extracting the faces adjacent to the edge that is gotten.
The function takes in as parameters, a bore point, a bore point, a bore direction and a body. Then, it fires a ray onto the body from the bore point along bore direction. Gets all the edges. Then, it gets the faces that at the edge. If it does not encounter any edge during the ray hit, it gets the first face along the ray if any.
[out] | pFace | face hit by the ray if there is no edge hit |
[out] | pFace1 | if an edge is hit by the ray, the first face at the edge |
[out] | pFace2 | second face at the edge |
[out] | pHitStatus | returns whether hit was successful |
[in] | pBorePt | start of ray |
[in] | pBoreDir | direction of ray |
[in] | body | input body to fire ray onto |
[in] | modelRef | model to which file belongs to |
MSPSOLID_EXPORT int mdlSolid_boresiteToEdge | ( | DPoint3d * | outPointP, |
EDGE_TAG * | outEdgeP, | ||
DPoint3d * | inPointP, | ||
DPoint3d * | inNormalP, | ||
BODY_TAG | body, | ||
bool | backupRayOrigin, | ||
DgnModelRefP | modelRef | ||
) |
Fires a ray from inPointP along inNormalP at the input body and
returns the first edge it hits as well as the intersection point.
The ray is usually defined in such a way that the ray origin is outside the body and its direction is towards the body, i.e., the given boresite point and direction are translated and reversed respectively. The boresite point can be inside the body. In this case if the backupRayOrigin is TRUE, the origin is backed up in a direction opposite to the ray direction until it is outside the body.
[out] | outPointP | is a pointer to the intersection point. |
[out] | outEdgeP | returns a pointer to the edge hit. |
[in] | inPointP | is the ray origin point, or boresite point. |
[in] | inNormalP | is a pointer to the input direction. |
[in] | body | is a pointer to the given body. |
[in] | backupRayOrigin | if this is TRUE, the origin of the ray is backed up in a direction opposite to the ray direction until it is outside the input body. |
[in] | modelRef | model in which the body is present |
MSPSOLID_EXPORT int mdlSolid_boresiteToFace | ( | DPoint3d * | outPointP, |
DPoint3d * | outNormalP, | ||
FACE_TAG * | outFaceP, | ||
DPoint3d * | inPointP, | ||
DPoint3d * | inNormalP, | ||
BODY_TAG | body, | ||
bool | backupRayOrigin, | ||
DgnModelRefP | modelRef | ||
) |
Fires a ray from inPointP along inNormalP at the input body and
returns the first face it hits as well as the intersection point and the normal direction of the face at this point.
The ray is usually defined in such a way that the ray origin is outside the body and its direction is towards the body, i.e., the given boresite point and direction are translated and reversed respectively. The boresite point can be inside the body. In this case if the backupRayOrigin is TRUE, the origin is backed up in a direction opposite to the ray direction until it is outside the body.
[out] | outPointP | is the intersection point. |
[out] | outNormalP | is the face normal at the intersection point. |
[out] | outFaceP | is the first face that the ray intersects |
[in] | inPointP | is the origin of the ray. |
[in] | inNormalP | is the input ray direction. |
[in] | body | is the body to find the face in. |
[in] | backupRayOrigin | determines whether the ray needs to be backed out of the body. |
[in] | modelRef | model in which the body is present (or the smartelement from which body is extracted is present) |
MSPSOLID_EXPORT int mdlSolid_boresiteToVertex | ( | DPoint3d * | outPointP, |
VERTEX_TAG * | outVertexP, | ||
DPoint3d * | inPointP, | ||
DPoint3d * | inNormalP, | ||
BODY_TAG | body, | ||
bool | backupRayOrigin, | ||
DgnModelRefP | modelRef | ||
) |
Fires a ray from inPointP along inNormalP at the input body and
returns the first vertex it hits as well as the intersection point.
The ray is usually defined in such a way that the ray origin is outside the body and its direction is towards the body, i.e., the given boresite point and direction are translated and reversed respectively. The boresite point can be inside the body. In this case if the backupRayOrigin is TRUE, the origin is backed up in a direction opposite to the ray direction until it is outside the body.
[out] | outPointP | is the intersection point in solids kernel units |
[out] | outVertexP | is the intersection vertex |
[in] | inPointP | is the boresite point in solids kernel units |
[in] | inNormalP | is the boresite normal |
[in] | body | is the body to intersect |
[in] | backupRayOrigin | determines whether the origin is projected to a point outside the bounding box of the body prior to processing. |
[in] | modelRef | model in which the body is present (or the model in which the smart element that the body is extracted from is present) |
MSPSOLID_EXPORT int mdlSolid_capSurface | ( | TAG_ENTITY_LIST * | faces, |
BODY_TAG * | lamina | ||
) |
Converts a sheet body to a solid by adding faces to fill up
"hollow spaces." Example of an application of this function is when you have sheet body in the shape of cube but with one face missing, then you can use this function to cap the sheet body and convert it into a solid body.
[out] | faces | is the list of faces in the solid body. |
[in] | lamina | is the input sheet body to be converted to a solid body. |
MSPSOLID_EXPORT StatusInt mdlSolid_checkBody | ( | BODY_TAG | body, |
bool | checkGeometry, | ||
bool | checkTopology, | ||
bool | checkSize | ||
) |
Checks the input body for geometric, topological and size validity.
A body must be valid for downstream modeling operations to work as expected. In general, a solids operation is guaranteed to succeed only if the input body passes these checks. A typical application of this function is when a translation is required to create the body in MicroStation. For example, if a body is imported using either IGES or STEP, this function can be used to check whether the imported body is valid for MicroStation's purposes. Usually, MicroStation solids operations on bodies leave the bodies in a valid state.
[in] | body | is the body that needs to be checked. |
[in] | checkGeometry | if TRUE, the function will fail in the following cases:
|
[in] | checkTopology | if TRUE, the function will fail in the following cases:
|
[in] | checkSize | if TRUE, the function will fail if any portion of the solid body lies outside the 1000x1000x1000 box. Bodies should lie within this box (in solid modeling kernel units) to be valid. When requiring a large solid working area, change the design file unit settings to get a larger solid modeling area. Note that changing the modeling area will increase the effective tolerance for the solid geometries. |
MSPSOLID_EXPORT int mdlSolid_checkEntity | ( | ENTITY_TAG | entityIn | ) |
Checks the topology and geometry of a given entity and writes the results to the MicroStation text window.
This function is intended for debugging and diagnostic purposes only.
[in] | entityIn | is a pointer to the given entity to check. |
MSPSOLID_EXPORT int mdlSolid_closestPointOnBody | ( | DPoint3dP | pointOutP, |
ENTITY_TAG * | entityOutP, | ||
double * | distanceP, | ||
BODY_TAG | body, | ||
TransformP | transP, | ||
DPoint3dP | pointP, | ||
DgnModelRefP | modelRef | ||
) |
Computes the closest point on the body and the entity on the body this point lies on.
For example, if the point on the body that is closest to the test point is a vertex, then the entity returned is that vertex. If the closest point lies on a FACE, then the entity returned is the face. Optionally a transformation matrix, transP, can be given. The input point will be inverse- tranformed by this matrix, if given, prior to the operation. Pass NULL for identity transformation.
[out] | pointOutP | is the closest point on the body |
[out] | entityOutP | is the component entity on which pointOutP lies. |
[out] | distanceP | is the distance from the test point to the closest point in solid kernel units |
[in] | body | is the input body |
[in] | transP | is an optional tranformation matrix applied to the point prior to processing |
[in] | pointP | is the test point |
[in] | modelRef | model in which the body is present (or the smartelement from which body is extracted is present) |
MSPSOLID_EXPORT int mdlSolid_closestPointToCurve | ( | DPoint3d * | clstPt, |
double * | param, | ||
DPoint3d * | testPt, | ||
EDGE_TAG | edge | ||
) |
Computes the closest point to the input test point on the input edge.
[out] | clstPt | is closest point to test point on edge in solids kernel units |
[out] | param | is the u parameter of clstPt on the edge |
[in] | testPt | is the test point |
[in] | edge | is the given edge |
MSPSOLID_EXPORT int mdlSolid_closestPointToEdge | ( | DPoint3d * | clstPt, |
double * | param, | ||
DPoint3d * | testPt, | ||
EDGE_TAG | edge | ||
) |
Computes the closest point to an edge from a given point.
It also calculates the tangent vector at the closest point.
[out] | clstPt | is the closest point on the edge. |
[out] | param | is the parameter value at the closest point. |
[in] | testPt | is the input test point. |
[in] | edge | is the input edge. |
MSPSOLID_EXPORT int mdlSolid_closestPointToFace | ( | DPoint3d * | clstPt, |
DPoint3d * | normal, | ||
DPoint2d * | param, | ||
DPoint3d * | testPt, | ||
FACE_TAG | face | ||
) |
Computes the closest point on the input face to a input point.
It also calculates the normal to the face at this point and the (u,v) parameters at that point.
[out] | clstPt | is the closest point on face to the given point. |
[out] | normal | is the normal direction at the closest point. |
[out] | param | is the (u,v) parameter at the closest point. |
[in] | testPt | input point to test. |
[in] | face | input face to test |
MSPSOLID_EXPORT int mdlSolid_closestPointToSurface | ( | DPoint3d * | clstPt, |
DPoint3d * | normal, | ||
DPoint2d * | param, | ||
DPoint3d * | testPt, | ||
FACE_TAG | face | ||
) |
Computes the closest point to the input test point on the input face.
[out] | clstPt | is the closest point on the face in kernel units |
[out] | normal | is the face normal direction at the closest point |
[out] | param | is the (u,v) parameters of the closest point on the surface (param- >x, param->y) |
[in] | testPt | is the input test point |
[in] | face | is the input face |
MSPSOLID_EXPORT int mdlSolid_coedgeData | ( | EDGE_TAG * | edge, |
ENTITY_TAG * | owner, | ||
COEDGE_TAG * | partner, | ||
COEDGE_TAG * | next, | ||
COEDGE_TAG * | prev, | ||
DPoint3d * | start, | ||
DPoint3d * | end, | ||
bool * | reversed, | ||
COEDGE_TAG | coedge | ||
) |
Returns topological and geometry information about the loop.
[out] | edge | the edge entity that the coedge references. An edge of a body may be referenced by one or more coedges in the body and for all these coedges, this will be the referenced egde. |
[out] | owner | is the owning loop of the body |
[out] | partner | is the partner coedge of the input coedge. In the normal case of a manifols solid, each edge is referenced by at most two coedges, each of which is a partner to the other. In such cases, the proper partner coedge is returned. In the case of open sheet bodies, there will be edge which are referenced by only one coedge. These coedges do not have a partner coedge and the returned value is NULL. In the case of non-manifold bodies, there may be cases where an edge is referenced by more than two coedges and in such cases the partner coedge may be any one of the other coedges that reference the same edge. |
[out] | next | is the next coedge in the loop. In the case of closed loops, this will return the first coedge in the loop when the input coedge 'coedge' is the last coedge in the loop. |
[out] | prev | is the previous coedge in the loop. In the case of closed loops, this will returns the last coedge in the loop when the input coedge 'coedge' is the first coedge in the loop. |
[out] | start | is the starting point of the edge referenced by the coedge |
[out] | end | is the ending point of the edge referenced by the coedge |
[out] | reversed | if reversed is TRUE, then the orientation of the COEDGE is opposite to that of the referenced EDGE. In the normal manifold case, each EDGE is referenced by two coedges, one in the same direction as the edge (reversed = FALSE) and the other in the opposite direction (reversed = TRUE). |
[in] | coedge | is the input coedge |
MSPSOLID_EXPORT int mdlSolid_coedgesFromEdge | ( | COEDGE_TAG * | coedge1P, |
COEDGE_TAG * | coedge2P, | ||
EDGE_TAG | edge | ||
) |
Returns all the coedge(s) that reference the input edge.
In case of open sheet bodies and wire bodies in which there may be edges referenced by only one coedge, the second coedge returned will be set to NULL.
[out] | coedge1P | is the first coedge referencing the input edge. |
[out] | coedge2P | is the second coedge refernced by the edge or NULL |
[in] | edge | is the given edge. |
MSPSOLID_EXPORT int mdlSolid_coedgeType | ( | ) |
Returns the COEDGE_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT StatusInt mdlSolid_combineBodies | ( | BODY_TAG | b1, |
BODY_TAG | b2 | ||
) |
Combines two possibly disconnected bodies into a single body by moving the lump from one body into the body of the other.
This is a purely topological operation and produces only a change in the data structure. The second body b2 is deleted and should not used henceforth.
[in] | b1 | the first body to join |
[in] | b2 | the second body to join |
MSPSOLID_EXPORT int mdlSolid_copyBody | ( | BODY_TAG * | copy, |
BODY_TAG | source | ||
) |
Make a copy of a body.
[out] | copy | is the copy. |
[in] | source | is the input body. |
MSPSOLID_EXPORT int mdlSolid_copyEntity | ( | ENTITY_TAG * | copy, |
ENTITY_TAG | source | ||
) |
Copies an entity and all the entities below it to a newly created
entity.
Memory is allocated to the new entity and the new entity must be separately deleted.
[out] | copy | is the newly created entity |
[in] | source | is the entity to be copied |
MSPSOLID_EXPORT int mdlSolid_coverWires | ( | TAG_ENTITY_LIST * | faceList, |
BODY_TAG | wires | ||
) |
Covers the input wire body by creating faces out of closed edges
and then fitting the faces with appropriate surfaces.
It first tries to fit a plane to the faces and it it fails, then it tries to fit spline surfaces to the faces. If it still fails, it leaves the face as a rubber face without a surface.
[out] | faceList | is the list of the faces made. |
[in] | wires | is the given wire body. |
MSPSOLID_EXPORT int mdlSolid_createChainFromEdgeList | ( | MSElementDescrH | outEdPP, |
TAG_ENTITY_LIST * | pEdgeList, | ||
MSElementP | templateP, | ||
DgnModelRefP | modelRef | ||
) |
Converts the set of edges input into an equivalent MicroStation chain of elements.
[out] | outEdPP | is the output chain of MicroStation elements. |
[in] | pEdgeList | is the input list of edges to create elements for |
[in] | templateP | gives the symbology to be used for creating the new element. Pass NULL to use the active symbology settings. |
[in] | modelRef | the model to create the element in |
MSPSOLID_EXPORT int mdlSolid_debugEntity | ( | ENTITY_TAG | entity, |
WCharCP | labelP | ||
) |
This function prints diagnostic messages about the entity including its type and data.
Consider the case of a simple cube. A call to this function prints out the that the cubical body consists of one lump, one shell, six faces, twelve edges, and eight vertices. It also prints out the types of surfaces and curves that make up the faces and edges respectively.
[in] | entity | is the entity to be debugged. |
[in] | labelP | is a string label to be printed in diagnostics, or NULL |
MSPSOLID_EXPORT void mdlSolid_debugEntitySize | ( | ENTITY_TAG | entityIn | ) |
This function prints diagnostic messages about the entity's size.
[in] | entityIn | is the entity about which the diagnostic messages will be printed. |
MSPSOLID_EXPORT int mdlSolid_deleteEntity | ( | ENTITY_TAG | e | ) |
Deletes the given entity and frees the memory allocated for it.
The entity should not be used henceforth.
[in,out] | e | is the entity to be deleted. |
MSPSOLID_EXPORT int mdlSolid_deleteNodeIdAttributes | ( | BODY_TAG | body | ) |
Removes node Ids and entity Ids from all the faces of a body and edge ids attached to edges of the body.
[in] | body | is the given body. |
MSPSOLID_EXPORT int mdlSolid_edgeCurveLength | ( | double * | length, |
double | startParam, | ||
double | endParam, | ||
EDGE_TAG | edge | ||
) |
Computes the length (in solids kernel units) of the edge
between the startParam and endParam parameters.
[out] | length | is the length of the curve between the startParam and endParam |
[in] | startParam | is the starting value of the curve parameter |
[in] | endParam | is the ending value of the curve parameter |
[in] | edge | is the input edge |
MSPSOLID_EXPORT int mdlSolid_edgeData | ( | VERTEX_TAG * | startVertexP, |
VERTEX_TAG * | endVertexP, | ||
DPoint3d * | startPointP, | ||
DPoint3d * | endPointP, | ||
double * | startParamP, | ||
double * | endParamP, | ||
COEDGE_TAG * | coEdgeP, | ||
CURVE_TAG * | curveP, | ||
bool * | reversedP, | ||
EDGE_TAG | edge | ||
) |
Returns topological and geometric information about the edge.
[out] | startVertexP | is the starting vertex of the edge. |
[out] | endVertexP | is the ending vertex of the edge. |
[out] | startPointP | is the starting point of the edge. |
[out] | endPointP | is the ending point of the edge. |
[out] | startParamP | is the parameter of the curve underlying the edge which corresponds to the starting vertex of the edge |
[out] | endParamP | is the parameter of the curve underlying the edge which corresponds to the starting vertex of the edge |
[out] | coEdgeP | returns a pointer to one of the coedges lying on the edge. If there is more than one coedge that references the edge, there is no sinificance attached to the coedge that is returned. |
[out] | curveP | returns the edge's underlying curve. |
[out] | reversedP | if the parametrization of the curve underlying the edge is in a direction opposite to that of the edge, then this value is returned as TRUE; otherwise FALSE. |
[in] | edge | is the input edge |
MSPSOLID_EXPORT int mdlSolid_edgeFaceIntersection | ( | TAG_ENTITY_LIST ** | interEnts, |
EDGE_TAG | e, | ||
FACE_TAG | f | ||
) |
Computes the intersections between the given edge and the given face.
Then, it makes up the containment of the intersections and forms the edges or vertices, depending on whether the intersections are isolated or coincident.
[out] | interEnts | intersecting entity list |
[in] | e | is the given edge. |
[in] | f | is the given face. |
MSPSOLID_EXPORT int mdlSolid_edgeFromId | ( | EDGE_TAG * | edgeP, |
EdgeId * | edgeIdP, | ||
BODY_TAG | body | ||
) |
Finds an edge which has the given edge id.
[out] | edgeP | returns a pointer to the edge. |
[in] | edgeIdP | is a pointer to the given edge id. |
[in] | body | is the body in which to search for edge |
MSPSOLID_EXPORT int mdlSolid_edgesFromId | ( | TAG_ENTITY_LIST * | edgeListP, |
EdgeId * | edgeIdP, | ||
BODY_TAG | body | ||
) |
Returns the entity list of edges in the input body that have the given edge ID.
[out] | edgeListP | is the list of edges matching the edge ID. |
[in] | edgeIdP | is the edge ID to match. |
[in] | body | body to search for the edges with the given edge ID. |
MSPSOLID_EXPORT int mdlSolid_edgeType | ( | ) |
Returns the EDGE_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT int mdlSolid_elementFromEdge | ( | MSElementDescrH | edPP, |
MSElementP | templateP, | ||
EDGE_TAG | edge, | ||
double * | startParameterP, | ||
double * | endParameterP, | ||
DgnModelRefP | modelRef | ||
) |
Creates an equivalent MicroStation element for the input kernel edge.
It also takes a start and end parameter if a MicroStation element representing a portion of the edge is needed.
[out] | edPP | is the equivalent MicroStation element |
[in] | templateP | template to be used in element creation. If NULL, the default values for symbology are used for the creation of the new element |
[in] | edge | is the edge element to convert. |
[in] | startParameterP | if NULL, the starting point of the element is the starting vertex of the edge. Otherwise, the starting point is the point on the edge indicated by this parameter. |
[in] | endParameterP | if NULL, the ending point of the element is the ending vertex of the edge. Otherwise, the ending point is the point on the edge indicated by this parameter. |
[in] | modelRef | the model in which element is to be created |
MSPSOLID_EXPORT StatusInt mdlSolid_elementToBody | ( | BODY_TAG * | bodyP, |
TransformP | bodyTransformP, | ||
MSElementDescrP | edP, | ||
DgnModelRefP | modelRef, | ||
UInt32 | nodeId = 1L |
||
) |
This function converts an element to a brep which can be a solid (type 19 elements), a sheet (type 18 elements, shapes, bspline surfaces, ellipses etc.) or a wire (curves, line strings etc).
If the input element is a smart element, the embedded brep is returned. The body needs to be deleted by the calling application after they are manipulated. When the optional body transform is being returned the body is left in the coordinates of the solids kernel, which is important to ensure that it is not transformed or scaled such that falls outside or exceeds the solids working area.
[out] | bodyP | is the body created by the function. |
[out] | bodyTransformP | is the currtrans scaled transform from solid kernel coordinates to MicroStation coordinates. |
[in] | edP | is the MicroStation element. |
[in] | modelRef | indicates the model containing the element. |
[in] | nodeId | when edP is not a smart element, the nodeId is used to assign face ids to the body, normally 1L. |
MSPSOLID_EXPORT StatusInt mdlSolid_elementToBodyList | ( | TAG_ENTITY_LIST ** | bodyListPP, |
NON_ENTITY_LIST ** | templateListPP, | ||
NON_ENTITY_LIST ** | transformListPP, | ||
MSElementDescrH | remainingEdPP, | ||
MSElementDescrP | edP, | ||
DgnModelRefP | modelRef, | ||
bool | getSolids, | ||
bool | getSheets | ||
) |
Converts a given element into a list of BODY_TAG entities.
[out] | bodyListPP | list of output BODY_TAG entities. The returned bodies need to be deleted using mdlSolid_deleteEntity. |
[out] | templateListPP | is a list of symbology template elements for each body. This should only be freed using mdlElmdscr_freeAll if not equal to edP. |
[out] | transformListPP | is a list of tranforms. The solid currtrans scaled display transform for each returned body. Free using dlmSystem_mdlFree, a NULL entry denotes a unit transform. |
[out] | remainingEdPP | is a list of unconverted elements. |
[in] | edP | is the element to be converted. |
[in] | modelRef | indicates the model containing the element. |
[in] | getSolids | add solids. |
[in] | getSheets | add sheets. {
TAG_ENTITY_LIST *bodyListP = NULL;
NON_ENTITY_LIST *transListP = NULL;
mdlSolid_beginCurrTrans (); // Establish the solids kernel->UORs transformation
if (SUCCESS == mdlSolid_elementToBodyList (&bodyListP, NULL, &transListP, NULL, edP, modelRef, true, true))
{
BODY_TAG bodyTag = 0L;
{
TransformP transP = NULL;
mdlSolid_listNthNonEntity (&transP, transListP, i);
// Do something with body...
if (NULL != transP)
dlmSystem_mdlFree (transP);
mdlSolid_deleteEntity (bodyTag);
}
}
mdlSolid_listDelete (&bodyListP);
mdlSolid_listDeleteNonEntity (&transListP);
}
|
MSPSOLID_EXPORT void mdlSolid_endCurrTrans | ( | ) |
This function pops the transform pushed by mdlSolid_beginCurrTrans.
Each call to this function must match a corresponding call to mdlSolid_beginCurrTrans.
MSPSOLID_EXPORT int mdlSolid_entityArea | ( | double * | area, |
double * | achTol, | ||
ENTITY_TAG | ent, | ||
double | reqTol | ||
) |
Calculates the surface area of a face, sheet body, or two-dimensional
general body.
Both requested and achieved accuracy are relative accuracy. For example, 0.01 means an accuracy of one percent.
[out] | area | is resultant surface area |
[out] | achTol | is the relative accuracy achieved. |
[in] | ent | is the given entity. |
[in] | reqTol | is the requested tolerance. |
MSPSOLID_EXPORT int mdlSolid_entityFromId | ( | ENTITY_TAG * | entityP, |
FaceId * | entityIdP, | ||
int | isEdge, | ||
BODY_TAG | body | ||
) |
Finds the entity matching the given face Id.
The face ID attribute can be on an edge or a vertex. The isEdge parameter should be set to TRUE if edges need to be queried, and set to FALSE if vertices should be queried. The found entity is returned in entityP.
[out] | entityP | is the entity matching the given face ID. |
[in] | entityIdP | is the faced ID attribute to look for on the body. |
[in] | isEdge | is TRUE=edge, FALSE=vertex. |
[in] | body | is the body containing the face or edge. |
MSPSOLID_EXPORT int mdlSolid_evaluateEdge | ( | DPoint3d * | pointP, |
DPoint3d * | duP, | ||
DPoint3d * | duuP, | ||
DPoint3d * | tangentP, | ||
DPoint3d * | normalP, | ||
DPoint3d * | binormalP, | ||
double | u, | ||
EDGE_TAG | edge | ||
) |
Evaluates an edge at the input parameter and computes the point,
the first derivative, second derivative, tangent vector, main normal vector and binormal vector of an edge at that parameter.
[out] | pointP | is the point on edge corresponding to the input paramter. |
[out] | duP | is the first derivative at the point. |
[out] | duuP | is the second derivative at the point. |
[out] | tangentP | is the tangent vector at the point. |
[out] | normalP | is the main normal vector at the point. |
[out] | binormalP | is the binormal vector at the point. |
[in] | u | is the given parameter value. |
[in] | edge | is the given edge. |
MSPSOLID_EXPORT int mdlSolid_evaluateFace | ( | DPoint3d * | pointP, |
DPoint3d * | normalP, | ||
DPoint3d * | duP, | ||
DPoint3d * | dvP, | ||
DPoint3d * | duuP, | ||
DPoint3d * | duvP, | ||
DPoint3d * | dvvP, | ||
double | u, | ||
double | v, | ||
FACE_TAG | face | ||
) |
Evaluates the face (or the surface underlying the face) at the
input parameter and returns the point, surface normal direction, first partial derivatives, second partial derivatives and mixed partial derivative of the face at the given parameter.
[out] | pointP | is the point on the face evaluated at the given parameter. |
[out] | normalP | is the surface normal direction at the point. |
[out] | duP | is the first partial derivative in u direction. |
[out] | dvP | is the first partial derivative in v direction. |
[out] | duuP | is the second partial derivative in u direction. |
[out] | duvP | is the mixed second partial derivative. |
[out] | dvvP | is the second partial derivative in v direction. |
[in] | u | is the given u parameter value. |
[in] | v | is the given v parameter value. |
[in] | face | is the face to evaluate. |
MSPSOLID_EXPORT int mdlSolid_extractId | ( | UInt32 * | nodeIdP, |
UInt32 * | entityIdP, | ||
ENTITY_TAG | entity | ||
) |
Extracts the node Id and entity Id from a given entity.
[out] | nodeIdP | returned node id |
[out] | entityIdP | returned entity Id. |
[in] | entity | the input entity. |
MSPSOLID_EXPORT int mdlSolid_faceData | ( | LOOP_TAG * | loop, |
FACE_TAG * | next, | ||
SURFACE_TAG * | surfaceP, | ||
bool * | reversedP, | ||
bool * | doubleSidedP, | ||
FACE_TAG | f | ||
) |
Returns the first loop in the input face, the next face in the
body, the surface underlying the face and sense information for the face.
[out] | loop | the first loop data of the face. |
[out] | next | the next face in the body or NULL if input face is last face in body |
[out] | surfaceP | is the surface underlying the input face |
[out] | reversedP | if TRUE the sense of the face is reversed that is the face normal is opposite in direction of the surface normal at any given point on the face |
[out] | doubleSidedP | has value TRUE if the face is a double sided face. Double sided faces are typically found in sheet bodies. A face of sheet body is always double sided. A double sided face indicates a infinitely thin wall of the body. |
[in] | f | is the input face |
MSPSOLID_EXPORT int mdlSolid_faceFaceIntersect | ( | BODY_TAG * | b, |
FACE_TAG | f1, | ||
FACE_TAG | f2 | ||
) |
Finds the intersect curve between two faces.
The intersection curve is represented by a wire body where each of its edges has two coedges.
[out] | b | returns a pointer to the wire body representing the intersection between the two faces. |
[in] | f1 | is the first face. |
[in] | f2 | is the second face. |
MSPSOLID_EXPORT int mdlSolid_faceFromId | ( | FACE_TAG * | faceP, |
FaceId * | faceIdP, | ||
BODY_TAG | body | ||
) |
Finds a face in the input body that has the given face id.
[out] | faceP | returns a pointer to the face. |
[in] | faceIdP | is a pointer to the given face id. |
[in] | body | is the given body. |
MSPSOLID_EXPORT int mdlSolid_faceFromLoop | ( | FACE_TAG * | faceP, |
LOOP_TAG | loop | ||
) |
Returns the face that owns the input loop.
[out] | faceP | is the face that owns the loop. |
[in] | loop | is the input loop |
MSPSOLID_EXPORT int mdlSolid_faceIntersectCurve | ( | DPoint3dP * | pointPP, |
DPoint2d ** | faceUVPP, | ||
double ** | curveParamPP, | ||
int * | numIntsP, | ||
FACE_TAG | face, | ||
CURVE_TAG | curve, | ||
double | startParam, | ||
double | endParam | ||
) |
Intersects the portion of the given curve between
startParam and endParam with the given face, and returns the absolute points of intersection between the curve and face, the surface parameters at the points of intersection, and the curve parameters at the points of intersection.
[out] | pointPP | is an array of points at which the face and curve intersect |
[out] | faceUVPP | is an array of surface (u,v) parameters at the points of intersection |
[out] | curveParamPP | is an array of curve parameters at the points of intersection |
[in] | numIntsP | is the number of points of intersection between the curve and the face |
[in] | face | is the input face |
[in] | curve | is the input curve |
[in] | startParam | is the start parameter on the curve |
[in] | endParam | is the end parameter on the curve |
MSPSOLID_EXPORT int mdlSolid_faceIntersectLine | ( | DPoint3dP * | pointPP, |
DPoint2d ** | uvPP, | ||
double ** | rayParamPP, | ||
int * | hitsFoundP, | ||
DPoint3d * | originP, | ||
DPoint3d * | dirP, | ||
FACE_TAG | face, | ||
BODY_TAG | body | ||
) |
Fires a ray from the origin, originP, along the direction,
dirP, towards the face, faceP, of the body.
It returns the number of intersections of the ray with the face in hitsFoundP. It also returns the following arrays, each of size *hitsFoundP: pointPP – array of intersection points in solids kernel coordinate system uvPP – array of (u,v) parameters of intersection points on the surface of the face rayParamPP – array of u parameters of intersection points on the ray
[out] | pointPP | array of intersection points |
[out] | uvPP | is the returned array of intersection u,v parameters on the face |
[out] | rayParamPP | is the returned array of intersection parameters on the line |
[out] | hitsFoundP | is number of intersections of the line with the face |
[in] | originP | is the origin of the line |
[in] | dirP | is the direction of the line |
[in] | face | is face to intersect the line with |
[in] | body | is the body |
MSPSOLID_EXPORT int mdlSolid_facesFromEdge | ( | FACE_TAG * | face1P, |
FACE_TAG * | face2P, | ||
EDGE_TAG | edge | ||
) |
Returns the faces that intersect at the input edge.
For a manifold edge from a solid body there should be two faces containing the edge. For edge from a sheet body there may be one or two faces.
[out] | face1P | is the first face containing the edge |
[out] | face2P | is the second face containing the edge (may be NULL) |
[in] | edge | is the edge to find adjoining faces for |
MSPSOLID_EXPORT int mdlSolid_facesFromId | ( | TAG_ENTITY_LIST * | faceListP, |
FaceId * | faceIdP, | ||
BODY_TAG | body | ||
) |
Returns the entity list of faces matching the input face ID.
[out] | faceListP | is the list of faces matching the given face ID. |
[in] | faceIdP | is the input face ID. |
[in] | body | body to search for the faces with the given face ID. |
MSPSOLID_EXPORT int mdlSolid_facetBodiesFromEntity | ( | TAG_ENTITY_LIST * | pList, |
ENTITY_TAG | entity, | ||
TransformP | pTransform, | ||
double | dChordHeight, | ||
double | dNormalAngle, | ||
double | dSideWidth, | ||
int | maxSides | ||
) |
Facets a solid or sheet body and returns a list of sheet bodies each of which represents a facet.
Typical applications of a faceted representation are in rendered displays and exchange of data with faceted brep modelers.
[out] | pList | list of sheet bodies that the function returns |
[in] | entity | the entity that is to be faceted |
[in] | pTransform | optional input transform that the user wants the facets to be transformed by |
[in] | dChordHeight | controls the type of facets produced. It specifies the maximum distance between the chord for the facet and the actual curve. The lower the value the greater the number of facets produced. |
[in] | dNormalAngle | maximum angle between the actual surface normal and its faceted approximation. The lower the value the more the number of facets produced. |
[in] | dSideWidth | maximum length of a side of a facet |
[in] | maxSides | maximum number of sides in a facet |
MSPSOLID_EXPORT StatusInt mdlSolid_facetBody | ( | DPoint3d ** | ppPoints, |
long * | pNumVertice, | ||
long ** | ppFacets, | ||
long * | pNumFacets, | ||
ENTITY_TAG | bodyTag, | ||
TransformP | pTransform, | ||
int | iMaxSides, | ||
double | dChordHeight, | ||
double | dNormalAngle, | ||
double | dSideWidth | ||
) |
This function is used to polygonize (facet) a body.
The faces of a body are polygonized and the output is in the form of sets of points. The planar polygon produced by joining the sets of points gives an approximate faceted representation of the body. This is only an approximate representation of the body. Typical applications of this function are in rendering, conversion to mesh and exchange of data with faceted brep modelers. The output arrays from this function must be explicitly freed by the user by a call to mdlSolid_freeFacetArray function.
[out] | ppPoints | is the array of points that represents the vertices making up the facets. Pass NULL to this value if not interested in this output. |
[out] | pNumVertice | is the number of vertices in ppPoints. Pass NULL to this value if not interested in this output. |
[out] | ppFacets | is an array of indices that represents the vertices of each facet.The value of (*ppFacets)[i] is index+1, where index is the entry in the point array ppPoints corresponding to this vertex of the facet. A value of 0 indicates the end of the list of vertices for a facet. For example, the first (iMaxSides+1) entries in ppFacets correspond to the first facet. The MaxSides+1th entry is 0 to indicate the end of the first facet. |
[out] | pNumFacets | is the number of facets, or null. |
[in] | bodyTag | is the body to polygonize |
[in] | pTransform | is the transformation, in solids kernel units, that will be applied to the body before faceting. This transform may only contain translation and rotation components; reflections, scales, shears and perspective are not allowed. Do not pass in the transform returned by mdlSolid_elementToBody and similar functions, as this transforms the body into MicroStation coordinates, and the faceter may fail. Typically, you should pass NULL. |
[in] | iMaxSides | is the maximum number of sides on a facet. For example, a value of three produces only triangular facets. |
[in] | dChordHeight | is the maximum distance, in solids kernel units, between a curve on the body and its facet edges, i.e. upper bound on the distance from the chord to the curve it approximates. This is also the maximum distance between a surface and its facet, i.e. the upper bound on the distance from aposition on a facet to the surface it approximates. To get more accurate facets and hence more number of facets, use a lower tolerance and for a looser set of facets, use a higher value for the tolerance. |
[in] | dNormalAngle | is the maximum angle in radians between a surface and its facet, i.e. the upper bound on the angle deviation between surfaces normals at any two positions under the facet. |
[in] | dSideWidth | is is the maximum width of a facet in solids kernel units. |
MSPSOLID_EXPORT StatusInt mdlSolid_facetBodyWithNormals | ( | DPoint3d ** | ppPoints, |
long * | pNumVertex, | ||
long ** | ppFacetVertex, | ||
DPoint3dP * | ppNormals, | ||
long * | pNumNormal, | ||
long ** | ppFacetNormal, | ||
long * | pNumFacets, | ||
ENTITY_TAG | bodyTag, | ||
TransformP | pTransform, | ||
int | iMaxSides, | ||
double | dChordHeight, | ||
double | dNormalAngle, | ||
double | dSideWidth | ||
) |
Polygonize a body allocating memory for the created arrays of vertex points, normals, and facets.
The caller is responsible for freeing the memory occupied by these arrays. To free the arrays the mdlSolid_freeFacetArray function must be used to make memory allocation and freeing consistent.
[out] | ppPoints | point list or NULL |
[out] | pNumVertex | number of vertices or NULL |
[out] | ppFacetVertex | vertext indices around facet |
[out] | ppNormals | normal list or NULL |
[out] | pNumNormal | number of normals or NULL |
[out] | ppFacetNormal | normal indices around facet |
[out] | pNumFacets | number of facets or NULL |
[in] | bodyTag | the body to mesh |
[in] | pTransform | is the transformation, in solids kernel units, that will be applied to the body before faceting. This transform may only contain translation and rotation components; reflections, scales, shears and perspective are not allowed. Do not pass in the transform returned by mdlSolid_elementToBody and similar functions, as this transforms the body into MicroStation coordinates, and the faceter may fail. Typically, you should pass NULL. |
[in] | iMaxSides | maximum number of vertices in each facet |
[in] | dChordHeight | chord height tolerance |
[in] | dNormalAngle | normal tolerance in radians |
[in] | dSideWidth | facet size tolerance |
MSPSOLID_EXPORT StatusInt mdlSolid_faceToElement | ( | MSElementDescrH | edPP, |
FACE_TAG | face, | ||
bool | wireframe, | ||
int | nIsoparametrics, | ||
MSElementP | templateP, | ||
DgnModelRefP | modelRef | ||
) |
Creates an equivalent MicroStation element for the input face.
[out] | edPP | equivalent MicroStation element for the input face |
[in] | face | the face to create an element for |
[in] | wireframe | if this parameter is TRUE, the elements created are wireframe elements and if it is FALSE, the elements are surface elements. For example, if the input is a rectangular face and wireframe is TRUE, we get an element that consists of four component line elements. If wireframe is FALSE, a single shape is created as the MicroStation element. |
[in] | nIsoparametrics | the number of isoparametrics or -1 to use default settings |
[in] | templateP | a template element to use. Pass NULL to use active symbology. |
[in] | modelRef | the model in which element is to be created |
MSPSOLID_EXPORT int mdlSolid_facetToIndices | ( | FacetCallbackFunc | funcId, |
ENTITY_TAG | entity, | ||
double | dNmax, | ||
double | dmax, | ||
double | hmax | ||
) |
Facets a body and provides the output to the calling application through a callback function.
[in] | funcId | pointer to a function of type DlmFacetCallback where DlmFacetCallback is defined as follows: The callback function takes five parameters, the last of which is unused. It is called for each facet output. The fourth argument of the callback function is the number of vertices in the facet. The first argument is the array of points, the second is the array of normals to the surface at these points and the third the parameter positions of the vertices. |
[in] | entity | the solid entity that needs to be facetted |
[in] | dNmax | the maximum angle between the surface normal and the facet normal (a typical value is 15 degrees (pass in 15/180 * fc_pi) |
[in] | dmax | the maximum distance between the surface and the planar facet |
[in] | hmax | the maximum allowable length of an edge of the facets |
MSPSOLID_EXPORT int mdlSolid_faceType | ( | ) |
Returns the FACE_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT StatusInt mdlSolid_findClosestPointOnBody | ( | DPoint3dP | pPointOut, |
ENTITY_TAG * | pEntityOut, | ||
double * | pDistance, | ||
BODY_TAG | bodyTagIn, | ||
TransformP | pTransformIn, | ||
DPoint3dP | pPointIn | ||
) |
Finds the closest point and the closest entity on the body from the input test point (pPointIn).
The input test point should be in solids kernel units. Optionally, a transformation matix (pTransformIn) can be given. If so, the input point will first be inverse_transformed by this matrix. Pass NULL to use identity transformation.
[out] | pPointOut | is the closest point on the body in solids kernel units. |
[out] | pEntityOut | is the closest entity. |
[out] | pDistance | is the distance from the input point to the output entity in soilds kernel units. |
[in] | bodyTagIn | is the input body. |
[in] | pTransformIn | is the transformation matrix. |
[in] | pPointIn | is the input point. |
MSPSOLID_EXPORT int mdlSolid_fixBlends | ( | BODY_TAG * | pBody | ) |
Makes implicit blend attributes on edges and vertices explicit.
A call to this function should be preceded by a call to a function such as mdlSolid_setConstantRounds that will set implicit blend attributes on the edges/vertices of the body. This function will attempt to create the actual blend faces for blend attributes present on edges/vertices of the body.
[in,out] | pBody | body in which explicit blend faces need to be created |
MSPSOLID_EXPORT int mdlSolid_fixBlendsWithSetback | ( | BODY_TAG * | pBody, |
TAG_ENTITY_LIST * | vertexListP, | ||
double | setback | ||
) |
Blends the edges of the specified solid applying the given setback value.
Setback values are used in the case of blends on two or more edges that meet at a vertex. The setback value is used to set back the blend faces of the edges from the vertex by the specified distance.
[in] | pBody | the body whose edges are to be blended |
[in] | vertexListP | the list of vertices for which the setback needs to be applied |
[in] | setback | the setback value to be applied |
MSPSOLID_EXPORT int mdlSolid_free | ( | void * | v | ) |
Frees memory allocated by the solid kernel when the results are
returned as arrays.
For example, if you use the mdlSolid_getEntities function the returned array of intersection points should be freed with a call to this function. However, to free the memory associated with an entity, the mdlSolid_deleteEntity function must be used.
[in] | v | is a pointer to input argument to be freed. |
MSPSOLID_EXPORT void mdlSolid_freeBody | ( | BODY_TAG | body | ) |
Frees the memory allocated for the body.
Internally, it simply calls mdlSolid_deleteEntity.
[in] | body | is the body to be freed. |
MSPSOLID_EXPORT void mdlSolid_freeFacetArray | ( | void * | pArray | ) |
Frees memory associated with the specified facet array.
Used with arrays produced by mdlSolid_facetBody and mdlSolid_facetBodyWithNormals.
[in] | pArray | the array pointer to free |
MSPSOLID_EXPORT int mdlSolid_getBodyBox | ( | DPoint3d * | lo, |
DPoint3d * | hi, | ||
BODY_TAG | b | ||
) |
Computes the bounding box of a body.
The box is an axis-aligned rectangular parallelepiped. When two bodies are tested for interaction, the boxes can be used first to filter out obvious disjoint cases.
[out] | lo | is the corner of the box with the minimum x, y, z coordinates. |
[out] | hi | is the corner of the box with the maximum x, y, z coordinates. |
[in] | b | is the input body. |
MSPSOLID_EXPORT void mdlSolid_getBoresite | ( | DPoint3d * | borePointP, |
DPoint3d * | boreDirectionP, | ||
DPoint3d * | pointP, | ||
int | view, | ||
DgnModelRefP | modelRef | ||
) |
Takes the input point pointP in the view specified by view, and returns the boresite point and boresite direction in solid kernel units.
[out] | borePointP | is the input point |
[out] | boreDirectionP | is boresite direction vector for the given view. The boresite direction is computed taking into account whether view is a camera view. |
[in] | pointP | input point |
[in] | view | input view |
[in] | modelRef | is used to transform the boresite point by the master to reference transform if modelRef does not equal MASTERFILE. |
MSPSOLID_EXPORT void mdlSolid_getBoresiteFromACS | ( | DPoint3dP | borePointP, |
DPoint3dP | boreDirectionP, | ||
DPoint3dCP | pointP, | ||
int | view, | ||
DgnModelRefP | modelRef, | ||
bool | useACS, | ||
bool | frontClipBorePoint | ||
) |
Returns a bore point and bore direction from the input point, view and ACS.
borepoint and boredirection are returned in solids kernel units so these points can be used in functions such as mdlSolid_boresiteToEdge to shoot rays at body entities to get intersection entities.
[out] | borePointP | is the boresite point returned in solids kernel units |
[out] | boreDirectionP | is the boresite direction returned in solids kernel units |
[in] | pointP | is the input point |
[in] | view | is the input view |
[in] | modelRef | indicates the model containing the ACS. |
[in] | useACS | if TRUE, the ACS z axis will be used, if FALSE the view z axis |
[in] | frontClipBorePoint | is the borepoint on the front clipping plane. useACS must be FALSE. |
MSPSOLID_EXPORT void mdlSolid_getCoEdgeList | ( | TAG_ENTITY_LIST * | listP, |
BODY_TAG | body | ||
) |
Returns all coedges of a body.
[out] | listP | is list of coedges. |
[in] | body | is the given body. |
MSPSOLID_EXPORT void mdlSolid_getEdgeList | ( | TAG_ENTITY_LIST * | listP, |
BODY_TAG | body | ||
) |
Returns all edges of the body.
[out] | listP | is the list of edges. |
[in] | body | is the given body. |
MSPSOLID_EXPORT int mdlSolid_getEdgeListFromFace | ( | TAG_ENTITY_LIST * | edgeListP, |
FACE_TAG | face | ||
) |
Returns all the edges that make up the loops of the face.
[out] | edgeListP | is the edge list returned |
[in] | face | is the given face. |
MSPSOLID_EXPORT int mdlSolid_getEdgeType | ( | EDGE_TAG | edgeTag | ) |
This function returns the type of the given edge entity.
[in] | edgeTag | is the edge entity whose type will be returned. |
MSPSOLID_EXPORT int mdlSolid_getEntities | ( | TAG_ENTITY_LIST * | hits, |
double ** | params, | ||
DPoint3dP | origin, | ||
DPoint3dP | dir, | ||
double | radius, | ||
int | type, | ||
BODY_TAG | b, | ||
DgnModelRefP | modelRef | ||
) |
Fires an infinite length ray of radius 'radius' from the input starting point, along the ray direction and returns the entities on the input body that the ray intersects with.
The parameter values on the ray at the points of intersection and the actual points of intersection are returned as the results. Only the entities of type 'type' are returned. The entity types can be determined using the function mdlSolid_faceType, mdlSolid_edgeType and mdlSolid_vertexType functions.
[out] | hits | is the list of entities found |
[out] | params | is the array of intersection parameters |
[in] | origin | is the input ray origin. |
[in] | dir | is the input ray direction. |
[in] | radius | is the ray radius. |
[in] | type | is the type of entity wanted. |
[in] | b | is the input body. |
[in] | modelRef | model in which the body is present (or the smartelement from which body is extracted is present) |
MSPSOLID_EXPORT int mdlSolid_getEntityBox | ( | DPoint3d * | lo, |
DPoint3d * | hi, | ||
ENTITY_TAG | en | ||
) |
Computes the bounding box of an entity.
The box is an axis-aligned rectangular parallelepiped. When two entities are tested for interaction, the boxes can be used first to filter out obvious disjoint cases.
[out] | lo | is the corner of the box with the minimum x, y, z coordinates. |
[out] | hi | is the corner of the box with the maximum x, y, z coordinates. |
[in] | en | is the given entity. |
MSPSOLID_EXPORT void mdlSolid_getFaceList | ( | TAG_ENTITY_LIST * | listP, |
BODY_TAG | body | ||
) |
Returns all faces in the body.
[out] | listP | is the entity list of faces. |
[in] | body | is the given body. |
MSPSOLID_EXPORT int mdlSolid_getFaceType | ( | FACE_TAG | faceTag | ) |
This function returns the type of the given face.
[in] | faceTag | is the face whose type will be returned. |
MSPSOLID_EXPORT void mdlSolid_getLocateBoresite | ( | DPoint3d * | borePointP, |
DPoint3d * | boreDirectionP, | ||
double * | radiusP, | ||
DgnModelRefP | modelRef | ||
) |
Returns a bore point and bore direction from the locate point.
Optionally returns the tolerance used for locating. Bore point is in solid kernel units.
[out] | borePointP | is the boresite point (in solids kernel units). |
[out] | boreDirectionP | is the boresite direction. |
[out] | radiusP | is the locate tolerance (in solids kernel units) or NULL. |
[in] | modelRef | indicates the model to get the borepoint from. |
MSPSOLID_EXPORT void mdlSolid_getLoopList | ( | TAG_ENTITY_LIST * | listP, |
BODY_TAG | body | ||
) |
Returns all loops in the body.
[out] | listP | is list of loops in the body. |
[in] | body | is the given body. |
MSPSOLID_EXPORT void mdlSolid_getNewSharedEdges | ( | TAG_ENTITY_LIST * | listP, |
BODY_TAG | body | ||
) |
Returns a list of edges that are newly created and have no node
ids attached.
It works by extracting the faces of the body that share the edge and then determining whether the faces have node and entity ids attached.
[out] | listP | is the entity list returned. |
[in] | body | is the input body. |
MSPSOLID_EXPORT double mdlSolid_getParasolidScale | ( | DgnModelRefP | modelRef | ) |
Returns the scale factor to convert from solid modeling kernel
units to Units of Resolution(UORs).
Unlike V7, this value is not fixed and depends on the model. This is also the scale of the transformation matrix pushed on the stack when mdlSolid_beginCurrTrans is called.
[in] | modelRef | the model whose solid modeling scale is required |
MSPSOLID_EXPORT void mdlSolid_getSmoothEdgeList | ( | TAG_ENTITY_LIST * | listP, |
FACE_TAG | edge, | ||
SmoothEdgeType | smoothEdges | ||
) |
This function adds an edge to a list of edges.
It will also add only smoothly connectd edges to the list if addSmoothEdges is TRUE.
[out] | listP | is the list of edges |
[in] | edge | is the input edge to add to the list, and to find the smooth edge sequence for |
[in] | smoothEdges | if TRUE, determines that only smoothly connected edges are added to the list |
MSPSOLID_EXPORT void mdlSolid_getSmoothFaceList | ( | TAG_ENTITY_LIST * | listP, |
FACE_TAG | face, | ||
bool | addSmoothFaces, | ||
int | allowedFaceTypeMask | ||
) |
This function adds a face to the list of faces, and also adds a face
smoothly connected to the faces in the list.
If addSmoothFaces is TRUE, only smoothly connected (i.e. tangent continuous) faces are added to the list. allowedFaceTypeMask is used to identify the types of faces that need to be added to the list. allowed facetypeMask need to be computed by performing a bitwise shift operation of 1 by the surface type and then doing a bit wise or operation for the different surface types. For example if planar faces alone are needed then allowedFaceTypeMask = (1 << PLANAR_FACE) If conical and spherical faces are needed then allowedFaceTypeMask = (1 << CONE_FACE) | (1 << SPHERE_FACE)
[in,out] | listP | is the list to which the face will be added. |
[in] | face | is the face to be added to the list. |
[in] | addSmoothFaces | determines whether only smooth faces will be added. If TRUE, only a face that is tangent continuous will be added. |
[in] | allowedFaceTypeMask | determines whether only a face of the same type as faceP will be added to the list. |
MSPSOLID_EXPORT StatusInt mdlSolid_getSurfaceElements | ( | MSElementDescrH | outEdPP, |
MSElementDescrP | inEdP, | ||
DgnModelRefP | modelRef | ||
) |
Creates an equivalent surface element for the input element.
A smart element is a cell that consists of two portions. The brep portion that is used for the manipulation and element portion that is used for display. There are two ways in which the display portion is represented, as surfaces or as curves. A cube for instance can be represented as six trimmed lines or six shapes. This function converts a smart element to a set of surfaces. If the input is a simple element and not a smart element it is first converted to a brep and then to surfaces.
[out] | outEdPP | output surface elements |
[in] | inEdP | input element (wireframe, surface or smart element) |
[in] | modelRef | the model containing the input element |
MSPSOLID_EXPORT void mdlSolid_getVertexList | ( | TAG_ENTITY_LIST * | listP, |
BODY_TAG | body | ||
) |
Returns all vertices of a body.
[out] | listP | is list of vertices in the body. |
[in] | body | is the given body. |
MSPSOLID_EXPORT int mdlSolid_getVertexListFromFace | ( | TAG_ENTITY_LIST * | vertexListP, |
FACE_TAG | face | ||
) |
Returns all the vertices that belong to a face.
[out] | vertexListP | is the list of face belonging to the face. |
[in] | face | is the face to extract vertices from. |
MSPSOLID_EXPORT int mdlSolid_hollowBody | ( | BODY_TAG | body, |
TAG_ENTITY_LIST * | oldFaceListP, | ||
TAG_ENTITY_LIST * | newFaceListP, | ||
double | offset, | ||
TAG_ENTITY_LIST * | noOffsetFaceListP, | ||
TAG_ENTITY_LIST * | offsetFaceListP, | ||
double * | offsetValuesP | ||
) |
Offsets faces of the input body by the offset distance provided to created a thin shell body.
Optionally, faces of the body can also be completely removed.
[in,out] | body | input/output body to be shelled |
[out] | oldFaceListP | old faces that were offset |
[out] | newFaceListP | new faces corresponding to ones in oldFaceListP that are obtained after offsetting the faces in oldFaceListP |
[in] | offset | default offset value or shell thickness |
[in] | noOffsetFaceListP | list of faces that need to be deleted |
[in] | offsetFaceListP | list of faces that need to be offset by distances other than the default distance |
[in] | offsetValuesP | list of offset values corresponding to faces in the offsetFaceListP |
MSPSOLID_EXPORT int mdlSolid_idFromEdge | ( | EdgeId * | edgeIdP, |
EDGE_TAG | edge, | ||
bool | useHighest | ||
) |
Get the edge id of an edge.
The edge id consists of face ids of its adjacent faces. When a face is split into two or more faces, sub-ids are assigned to each new face. So a face may have a list of id attributes attached. Set useHighest to TRUE to get the highest face ids for the adjacent faces of the edge. Otherwise, the lowest ids are returned. The highest will be the most recently generated.
[out] | edgeIdP | is a pointer to the edge id returned. |
[in] | edge | is the given edge. |
[in] | useHighest | is TRUE if the highest id is requested. |
MSPSOLID_EXPORT int mdlSolid_idFromEntity | ( | FaceId * | faceIdP, |
ENTITY_TAG | ent, | ||
bool | useHighestId | ||
) |
Get the faceID (node-ID, entity-ID) pair of the input entity.
If useHighestId is tru, the faceID with the highest node-ID is returned. If the node-IDs of all the faceIDs on the entity are the same, then the faceID with the highest entity-ID is returned.
[out] | faceIdP | is the returned faceID pair. |
[in] | ent | is the entity for which the faceID is returned. |
[in] | useHighestId | determines whether the highest entity ID is returned. |
MSPSOLID_EXPORT int mdlSolid_idFromFace | ( | FaceId * | faceIdP, |
FACE_TAG | face, | ||
bool | useHighest | ||
) |
Get the face id of a face.
When a face is split into two or more faces, sub-ids are assigned to each new face. Thus, a face may have a list of id attributes attached. Set useHighest to TRUE to get the highest face ids. Otherwise, the lowest ids are retuned. The highest will be the most recently generated.
[out] | faceIdP | is a pointer to the face id returned. |
[in] | face | is the given face. |
[in] | useHighest | is TRUE if the highest face id is requested. |
MSPSOLID_EXPORT int mdlSolid_idFromVertex | ( | VertexId * | vertexIdP, |
VERTEX_TAG | vertex, | ||
bool | useHighest | ||
) |
Get the vertex id of a vertex.
The vertex id consists of face ids of its surrounding faces. When a face is split into two or more faces, sub-ids are assigned to each new face. So a face may have a list of id attributes attached. Set useHighest to TRUE to get the highest face ids for all the surrounding faces of the vertex. Otherwise, the lowest ids are returned. The highest will be the most recently generated. The partNodeIdP points to the id of the part to which the given vertex belongs.
[out] | vertexIdP | is a pointer to the vertex id returned. |
[in] | vertex | is the given vertex to get id from. |
[in] | useHighest | is TRUE if the highest id is requested. |
MSPSOLID_EXPORT StatusInt mdlSolid_imprintBodies | ( | TAG_ENTITY_LIST * | pTargetEdges, |
TAG_ENTITY_LIST * | pToolEdges, | ||
BODY_TAG | target, | ||
BODY_TAG | tool, | ||
double | tolerance, | ||
bool | imprintTool | ||
) |
Intersects the two input bodies and imprints their intersection
on one, or both, by adding new edges and faces.
[out] | pTargetEdges | is a list of the new edges imprinted on the target body, or NULL if no edges are imprinted. |
[out] | pToolEdges | is a list of the new edges imprinted on the tool body, or NULL if no edges are imprinted. |
[in,out] | target | is the target body |
[in,out] | tool | is the tool body |
[in] | tolerance | is the tolerance value for imprinting. |
[in] | imprintTool | is a boolean that determines whether the tool body is imprinted with new faces and edges. Set this value to FALSE to prevent the tool body from being imprinted. |
MSPSOLID_EXPORT StatusInt mdlSolid_imprintCurveNormal | ( | TAG_ENTITY_LIST * | pImprintList, |
BODY_TAG | body, | ||
TAG_ENTITY_LIST * | pEdgeList, | ||
double | tolerance | ||
) |
This function takes as input a body and a list of edges and tries to imprint the edges on to the body.
The imprinted edges (new edges on the body) are returned in the output imprintList. The curves (of the supplied edges) are projected down the face normals of the body for the purposes of imprinting. The 'tolerance' parameter is used to resolve resolution problems and also for calculating any parametric space curves needed.
[out] | pImprintList | output imprinted edges on the body (can be NULL) |
[in] | body | input body on which curves are to be imprinted |
[in] | pEdgeList | input list of curves to imprint |
[in] | tolerance | tolerance to be used for resolving resolution problems and for computation of parametric space curve approximations. The recommended value is 1E-5. |
MSPSOLID_EXPORT StatusInt mdlSolid_imprintCurveVector | ( | TAG_ENTITY_LIST * | pImprintList, |
BODY_TAG | body, | ||
TAG_ENTITY_LIST * | pEdgeList, | ||
DPoint3d * | pVector, | ||
double | tolerance | ||
) |
This function is similar to the mdlSolid_imprintCurveNormal except that instead of projecting curves along face normals, it takes an explicit vector along which the curves are projected.
[out] | pImprintList | output imprinted edges on the body (can be NULL) |
[in] | body | input body on which curves are to be imprinted |
[in] | pEdgeList | input list of curves to imprint |
[in] | pVector | vector to project curve along |
[in] | tolerance | tolerance to be used for resolving resolution problems and for computation of parametric space curve approximations. The recommended value is 1E-05. |
MSPSOLID_EXPORT int mdlSolid_intersect | ( | BODY_TAG | b2, |
BODY_TAG | b1 | ||
) |
Intersects the two input bodies and leaves the result in b2.
b1 is deleted and should not be used henceforth. If the two bodies do not intersect, b2 is returned unchanged and b1 is deleted.
[in,out] | b2 | second body |
[in] | b1 | first body |
MSPSOLID_EXPORT bool mdlSolid_isAnalyticBody | ( | BODY_TAG | bodyTag | ) |
Determines whether the surfaces underlying the faces
in a body are analytic (non b-spline) surfaces.
[in] | bodyTag | is the input body to be tested. |
MSPSOLID_EXPORT bool mdlSolid_isBody | ( | ENTITY_TAG | entityTag | ) |
Checks whether input entity is a body or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isCoEdge | ( | ENTITY_TAG | entityTag | ) |
Checks if input entity is COEDGE or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isEdge | ( | ENTITY_TAG | entityTag | ) |
Checks if input entity is EDGE or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isFace | ( | ENTITY_TAG | entityTag | ) |
Checks if entity is FACE or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isGeneralBody | ( | BODY_TAG | bodyTag | ) |
This function determines whether the input body is a general
(non-manifold) body.
A non-manifold body is one that can never be created in the real world. An example of a non-manifold body is one in which more than two faces intersect along an edge. A mixed-dimension body is also a general body.
[in] | bodyTag | is the input body to be tested. |
MSPSOLID_EXPORT bool mdlSolid_isLoop | ( | ENTITY_TAG | entityTag | ) |
Checks if input entity is loop or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isLump | ( | ENTITY_TAG | entityTag | ) |
Checks if the input entity is a lump or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isMinimalBody | ( | BODY_TAG | bodyTag | ) |
Tests whether the given body is the simplest type of manifold
body, a minimum (or minimal) body, sometimes called an "acorn".
A minimal body does not even have a length.
[in] | bodyTag | is the body to be tested |
MSPSOLID_EXPORT bool mdlSolid_isModelerElement | ( | MSElementDescrP | edP | ) |
Tests whether the element is a modeler element (has a node
linkage attached to it)
[in] | edP | is the element to be tested. |
MSPSOLID_EXPORT bool mdlSolid_isSheetBody | ( | BODY_TAG | bodyTag | ) |
Determines whether the input body is a sheet body.
A sheet body is a topologically two dimensional body which does not have a volume but only an area. The walls of a sheet body are infinitely thin.
[in] | bodyTag | is the input body. |
MSPSOLID_EXPORT bool mdlSolid_isSheetElement | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Determines whether the input element is an element
that can be represented as a sheet body.
For the purpose of this test, a sheet element is one of the following:
[in] | edP | is the element to be tested |
[in] | modelRef | is the model containing the element |
MSPSOLID_EXPORT bool mdlSolid_isSheetOrSolidElement | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Determines whether the input element is a sheet or solid element.
[in] | edP | is the element to be tested. |
[in] | modelRef | is the model containing the element. |
MSPSOLID_EXPORT bool mdlSolid_isShell | ( | ENTITY_TAG | entityTag | ) |
Checks if entity is SHELL or not.
[in] | entityTag | is a pointer to the entity to check. |
MSPSOLID_EXPORT bool mdlSolid_isSmartElement | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Determines whether the input element is a smartsolid
or smartsheet.
[in] | edP | is the element to test. |
[in] | modelRef | is the model containing the element. |
MSPSOLID_EXPORT bool mdlSolid_isSmartSheetElement | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Determines whether the input element is a smartsheet
element.
A smartsheet element is one which has an embedded brep linkage attached to it from which a sheet body can be obtained.
[in] | edP | is the element to be tested. |
[in] | modelRef | is the model that contains the element to test. |
MSPSOLID_EXPORT bool mdlSolid_isSmartSolidElement | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Determines whether the input element is a smartsolid element.
A smartsolid element is one which has an embedded brep linkage attached to it and where the underlying brep represents a kernel solid.
[in] | edP | is the element to be tested. |
[in] | modelRef | is the model that the element is in. |
MSPSOLID_EXPORT bool mdlSolid_isSmoothEdge | ( | EDGE_TAG | edge | ) |
Checks whether the two adjacent faces of the given edge are
connected with tangent continuity.
For example, when a constant round is added to an edge of a solid cube, a new face between the two faces that shared the edge is created. The two straight edges that bound the new blend face are smooth edges since the adjacent faces of the edge meet at tangential continuity.
[in] | edge | is the edge to test. |
MSPSOLID_EXPORT bool mdlSolid_isSolidBody | ( | BODY_TAG | bodyTag | ) |
Determines whether the input body is a solid body.
A solid body is a topologically three dimensional body that has a finite non-zero volume.
[in] | bodyTag | is the input body to be tested. |
MSPSOLID_EXPORT bool mdlSolid_isSolidElement | ( | MSElementDescrP | edP, |
DgnModelRefP | modelRef | ||
) |
Determines whether the input element is a solid element.
For the purpose of this test, a solid is one of the following:
[in] | edP | is the element to test. |
[in] | modelRef | is the model containing the element. |
MSPSOLID_EXPORT bool mdlSolid_isVertex | ( | ENTITY_TAG | entityTag | ) |
Tests whether input entity is vertex or not.
[in] | entityTag | is the entity to test. |
MSPSOLID_EXPORT bool mdlSolid_isWireBody | ( | BODY_TAG | bodyTag | ) |
This function determines whether the input body is a wire body.
A wire body is a topologically unidimensional body which neither has an area nor a volume but just a finite non-zero length. An example of a wire body is a body formed from a trimmed line.
[in] | bodyTag | is the input body to be tested. |
MSPSOLID_EXPORT int mdlSolid_listAdd | ( | TAG_ENTITY_LIST * | lP, |
ENTITY_TAG | ent | ||
) |
Appends an entity to the end of the entity list.
[in] | lP | is a pointer to the entity list. |
[in] | ent | is the entity to add to the list. |
MSPSOLID_EXPORT int mdlSolid_listAddList | ( | TAG_ENTITY_LIST * | lDP, |
TAG_ENTITY_LIST * | lSP | ||
) |
Adds the contents of list lSP to an existing list lDP.
[in,out] | lDP | is a list of entities to which the input list is added. |
[in] | lSP | is a list of entities which are added to an existing list. |
MSPSOLID_EXPORT int mdlSolid_listCount | ( | int * | count, |
TAG_ENTITY_LIST * | lP | ||
) |
Returns the number of entries in an entity list.
[out] | count | entry count |
[in] | lP | input entity list |
MSPSOLID_EXPORT int mdlSolid_listCreate | ( | TAG_ENTITY_LIST ** | lP | ) |
Creates an empty entity list.
The user needs to free the memory allocated for the entity list by calling mdlSolid_listDelete.
[in,out] | lP | entity list |
MSPSOLID_EXPORT int mdlSolid_listDelete | ( | TAG_ENTITY_LIST ** | lP | ) |
Frees the memory allocated for the entity list.
Does not free the memory associated with the list entries. entities.
[in,out] | lP | entity list |
MSPSOLID_EXPORT int mdlSolid_listEmpty | ( | TAG_ENTITY_LIST * | lP | ) |
Removes all entries from an entity list.
The entities that were referenced by the entity list are not deleted.
[in] | lP | is the list of entities to be emptied. |
MSPSOLID_EXPORT int mdlSolid_listLookup | ( | int * | nth, |
TAG_ENTITY_LIST * | lP, | ||
ENTITY_TAG | ent | ||
) |
Searches for a given entity and returns its zero based index in the list.
If entity is not in the list, an index of -1 is returned for nth.
[out] | nth | index of the entity |
[in] | lP | input entity list. |
[in] | ent | entity to look up |
MSPSOLID_EXPORT int mdlSolid_listNthEl | ( | ENTITY_TAG * | entP, |
TAG_ENTITY_LIST * | lP, | ||
int | nth | ||
) |
Returns the entity at a given index in an entity list.
[out] | entP | entity returned |
[in] | lP | input entity list |
[in] | nth | input zero based index. A value of 0 fetches the first entity in list and a value of count-1 returns the last entity in the list |
MSPSOLID_EXPORT int mdlSolid_listRemove | ( | TAG_ENTITY_LIST * | lP, |
ENTITY_TAG | ent | ||
) |
Removes an entity from an entity list.
The entity is not deleted.
[in,out] | lP | is the entity list from which the input entity will be removed. |
[in] | ent | is the entity to be removed from the given list. |
MSPSOLID_EXPORT StatusInt mdlSolid_listRemoveByIndex | ( | TAG_ENTITY_LIST * | listP, |
int | index | ||
) |
Removes the entry at a supplied index from an entity list.
The entity at the specificed index is not deleted.
[in,out] | listP | is the entity list to modify |
[in] | index | is the index of the entry to remove. |
MSPSOLID_EXPORT bool mdlSolid_locateBodyList | ( | FACE_TAG * | faceP, |
EDGE_TAG * | edgeP, | ||
DPoint3dP | outPointP, | ||
int * | bodyIndexP, | ||
TAG_ENTITY_LIST * | bodyListP, | ||
NON_ENTITY_LIST * | transformListP, | ||
DPoint3dP | inPointP, | ||
double | locateTolerance, | ||
int | view, | ||
DgnModelRefP | modelRef | ||
) |
Given a datapoint and a view, this function can be used to get the closest face and edge among a list of bodies.
Based on the view, the model and the data point, it caclulates a bore point and a bore direction. It uses this information to create a ray, which is fired onto the bodies. The closest face and edge along this ray are returned to the user.
[out] | faceP | the closest face |
[out] | edgeP | the closest edge |
[out] | outPointP | This returns the point at which the edge intersects the ray if at least one edge is found. If not, it intersects the point at which the ray hits the returned face if at least one face is hit |
[in] | bodyIndexP | this returns the index into the input body list to which the edge belongs or in case there is no edge returned, the body to which the face belongs to |
[in] | bodyListP | input list of bodies to find the closest face and edge from |
[in] | transformListP | Transforms for the bodies that are input |
[in] | inPointP | input datapoint |
[in] | locateTolerance | a locate tolerance value |
[in] | view | the index of the view displaying the body |
[in] | modelRef | the model that contains the body |
MSPSOLID_EXPORT int mdlSolid_loopData | ( | FACE_TAG * | face, |
COEDGE_TAG * | coedge, | ||
LOOP_TAG * | next, | ||
LOOP_TAG | l | ||
) |
Returns the face containing the loop, the first coedge in the loop, and
the next loop in the face.
[out] | face | is the containing face that owns the loop. |
[out] | coedge | the first coedge in the loop. |
[out] | next | the next loop in the face or NULL if input loop is last loop in face. |
[in] | l | is the input loop |
MSPSOLID_EXPORT int mdlSolid_loopExternal | ( | int * | isExternal, |
LOOP_TAG | l | ||
) |
Determines if a loop is an internal or external loop of a face.
External loops of a face go around the face in the anticlockwise direction.
[out] | isExternal | has value TRUE if the loopP is external. |
[in] | l | is a pointer to the loop to test. |
MSPSOLID_EXPORT int mdlSolid_loopFromCoedge | ( | LOOP_TAG * | loopP, |
COEDGE_TAG | coedge | ||
) |
Returns the loop that owns the coedge.
[out] | loopP | is the loop returned. |
[in] | coedge | is the given coedge. |
MSPSOLID_EXPORT int mdlSolid_loopType | ( | ) |
Returns the LOOP_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT int mdlSolid_lowestUniqueIdFromEdge | ( | EdgeId * | edgeIdP, |
EDGE_TAG | edge | ||
) |
Returns the lowest edge ID on the edge.
The edge ID is unique within a body.
[out] | edgeIdP | is the edge ID |
[in] | edge | is the edge |
MSPSOLID_EXPORT int mdlSolid_lumpData | ( | SHELL_TAG * | shell, |
LUMP_TAG * | next, | ||
LUMP_TAG | l | ||
) |
Returns the first shell data and the next lump pointed to by
the given lump.
[out] | shell | is the first shell of the lump. |
[out] | next | is the next lump in the body or NULL, if input is the last lump. |
[in] | l | is the input lump. |
MSPSOLID_EXPORT int mdlSolid_lumpType | ( | ) |
Returns the LUMP_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT int mdlSolid_makeCone | ( | BODY_TAG * | coneP, |
double | height, | ||
double | base, | ||
double | top | ||
) |
Creates a solid conical body with the input parameters.
The point on the cone's axis halfway from the bottom to the top is 0,0,0.
[out] | coneP | is a cylinder |
[in] | height | is the height (in kernel units) of the cylinder |
[in] | base | is the base radius (in kernel units) |
[in] | top | is the top radius (in kernel units) |
MSPSOLID_EXPORT int mdlSolid_makeCuboid | ( | BODY_TAG * | cuboidP, |
double | dx, | ||
double | dy, | ||
double | dz | ||
) |
Creates a solid cuboidal (rectangular box) body centered at 0,0,0 and aligned with x, y, z axes.
The length, width, and height must all be greater than zero.
[out] | cuboidP | output cuboid body created. |
[in] | dx | is the length (in kernel units) in the x-axis direction. |
[in] | dy | is the width (in kernel units) in the y-axis direction. |
[in] | dz | is the height (in kernel units) in the z-axis direction. |
MSPSOLID_EXPORT StatusInt mdlSolid_makeLineCurve | ( | CURVE_TAG * | pCurveTagOut, |
DPoint3dP | pStartPointIn, | ||
DPoint3dP | pEndPointIn | ||
) |
Creates a finite kernel line entity given the start and end points of the line.
[out] | pCurveTagOut | output CURVE_TAG |
[in] | pStartPointIn | is the start point (in kernel units) of the line |
[in] | pEndPointIn | is the endpoint (in kernel units) of the line |
MSPSOLID_EXPORT int mdlSolid_makePlane | ( | BODY_TAG * | bodyP, |
DPoint3dP | pointP, | ||
DPoint3dP | normalP, | ||
DPoint3dP | refDirP, | ||
double * | intervalP | ||
) |
Creates a finite planar rectangular sheet body.
The parametrization for the plane depends on the input parameters which include a point on the plane, normal to the plane and a reference direction. The interval input defines the boundary of the sheet.
[out] | bodyP | is the planar sheet body. |
[in] | pointP | is the origin of the plane (in kernel units); if NULL, 0,0,0 is used. |
[in] | normalP | is the z-axis of the plane; if NULL, 0,0,1 is used. |
[in] | refDirP | is the x-axis of plane; if NULL 1,0,0 is used. |
[in] | intervalP | is the u,v range box (array of 4 doubles: umin, vmin, umax, vmax) of the plane; if NULL, 0,0 to 1,1 is used. |
MSPSOLID_EXPORT int mdlSolid_makePrism | ( | BODY_TAG * | prismP, |
double | height, | ||
double | radius, | ||
int | nSides | ||
) |
Creates a solid circular prism of the given height, radius, and number of sides.
The center of the prism is at 0,0,0. The first face is perpendicular to the positive x-axis. The radius defines the circle circumscribing the prism cross-section. The number of the sides should be greater than two.
[out] | prismP | output circular prism body |
[in] | height | is the height (in kernel units) of the prism. |
[in] | radius | is the radius (in kernel units) of the circle circumscribing the prism cross-section. |
[in] | nSides | is the number of the sides of the prism. |
MSPSOLID_EXPORT int mdlSolid_makeSheetBody | ( | BODY_TAG * | bodyP, |
SURFACE_TAG | surfTag, | ||
double * | intervalP | ||
) |
Given a surface and parameter boundaries, it creates a sheet body representing the surface within the rectangular parametric box.
[out] | bodyP | is the sheet body created from the surface |
[in] | surfTag | is the surface to be used in sheet body creation |
[in] | intervalP | is the range box (array of 4 doubles: umin, vmin, umax, vmax) of the surface. If included, the surface is parameterized in the specified range box. If NULL, the surface is parameterized in the default range box (0,0) to (1,1). |
MSPSOLID_EXPORT int mdlSolid_makeSphere | ( | BODY_TAG * | sphereP, |
double | radius | ||
) |
Creates a solid spherical body with the input radius and center at 0,0,0.
[out] | sphereP | sphere created |
[in] | radius | is the radius (in kernel units) of the sphere. |
MSPSOLID_EXPORT int mdlSolid_makeTorus | ( | BODY_TAG * | bodyP, |
double | primaryRadius, | ||
double | secondaryRadius, | ||
double | angle | ||
) |
Creates a solid torus with input major and minor radii.
The torus is centered at 0,0,0 and its major radius aligned with the x-axis.
[out] | bodyP | torus created. |
[in] | primaryRadius | is the primary radius (in kernel units). |
[in] | secondaryRadius | is the secondary radius (in kernel units). |
[in] | angle | input torus sweep angle (in degrees) |
MSPSOLID_EXPORT int mdlSolid_makeWedge | ( | BODY_TAG * | bodyP, |
double | radius, | ||
double | height, | ||
double | angle | ||
) |
Creates a pie-shaped solid (wedge) from the supplied input parameters.
The point on the wedge's axis of revolution haflway from the bottom to the top is 0,0,0.
[out] | bodyP | is the wedge body |
[in] | radius | is the input radius (in kernel units) of the wedge (distance from circular edge to center) |
[in] | height | is the input height (in kernel units) of the wedge |
[in] | angle | is the input sweep angle (in degrees) of the wedge |
MSPSOLID_EXPORT int mdlSolid_minimumDistanceBetweenEntities | ( | DPoint3dP | pPoint1, |
DPoint3dP | pPoint2, | ||
double * | pDistance, | ||
ENTITY_TAG | entity1, | ||
ENTITY_TAG | entity2 | ||
) |
Compute minimum distance between two entities.
[out] | pPoint1 | is the point on the first entity where the minimum distance is achieved. |
[out] | pPoint2 | is the point on the second entity where the minimum distance is achieved. |
[out] | pDistance | is minimum distance value. |
[in] | entity1 | is the first entity. |
[in] | entity2 | is the second entity. |
MSPSOLID_EXPORT StatusInt mdlSolid_msBsplineToCurve | ( | CURVE_TAG * | curveP, |
MSBsplineCurve * | msbCurveP | ||
) |
Creates a curve in the solid kernel from a b-spline curve definition.
[out] | curveP | output kernel curve |
[in] | msbCurveP | input MicroStation b-spline curve to convert |
MSPSOLID_EXPORT StatusInt mdlSolid_msBsplineToCurve2d | ( | CURVE_TAG * | curveP, |
MSBsplineCurve * | msbCurveP | ||
) |
Creates a planar curve in the solid kernel from a b-spline curve definition.
Any non-zero z component of the input b-spline curve will be disregarded.
[out] | curveP | is the 2d curve. |
[in] | msbCurveP | input MicroStation b-spline curve to convert |
MSPSOLID_EXPORT StatusInt mdlSolid_msBsplineToSurface | ( | SURFACE_TAG * | surfaceP, |
MSBsplineSurface * | msbSurfP | ||
) |
Creates a surface in the solid kernel from a b-spline surface definition.
The new surface entity can be used to create a sheet body for use in sheet modeling operations.
[out] | surfaceP | output kernel surface entity |
[in] | msbSurfP | input MicroStation b-spline surface element to be converted |
MSPSOLID_EXPORT int mdlSolid_offsetFaces | ( | TAG_ENTITY_LIST * | pFaceList, |
double * | pOffset, | ||
double | tolerance, | ||
bool | faceFaceCheck | ||
) |
Offsets an input set of faces by the provided offset distances.
All faces must belong to the same body.
[in] | pFaceList | list of faces to be offset |
[in] | pOffset | array of offset distances for each face |
[in] | tolerance | tolerance to be used while recalculating offset geometry |
[in] | faceFaceCheck | if this is true, the resultant body is checked for face face intersection errors. |
MSPSOLID_EXPORT int mdlSolid_offsetWire | ( | TAG_ENTITY_LIST * | pOffsetList, |
BODY_TAG | wireBody, | ||
EDGE_TAG | refEdge, | ||
DPoint3d * | pNormal, | ||
double | distance, | ||
double | tolerance, | ||
int | gapFill, | ||
bool | localCheck | ||
) |
Returns a list of edges that are the offset edges of the input wire body.
[out] | pOffsetList | list of offset edges |
[in] | wireBody | input wire body |
[in] | refEdge | an edge of the wire body. Use mdlSolid_bodyAskFirstEdge to obtain one |
[in] | pNormal | normal direction of the plane in which the wire body lies |
[in] | distance | offset distance |
[in] | tolerance | tolerance for converting general curves to B-spline curves before offset |
[in] | gapFill | 0 for arc fill, 1 for tangent extension fill, 2 for curve extension fill |
[in] | localCheck | TRUE for performing local check. FALSE otherwise. |
MSPSOLID_EXPORT int mdlSolid_planarFaceData | ( | DPoint3d * | rootPointP, |
DPoint3d * | normalP, | ||
FACE_TAG | face | ||
) |
Finds a point on the face and computes the normal direction of the face.
The normal direction always points to the outside of the enclosed body no matter what the sense of the face is. It only works on planar faces and returns an ERROR if the face is not a planar face
[out] | rootPointP | is a point on the face. |
[out] | normalP | is the normal direction of the face. |
[in] | face | is the given face. |
MSPSOLID_EXPORT StatusInt mdlSolid_planarFaceToElement | ( | MSElementDescrH | edPP, |
FACE_TAG | face, | ||
DgnModelRefP | modelRef | ||
) |
Creates an equivalent MicroStation element for the input planar face.
[out] | edPP | output MicroStation element. |
[in] | face | is the planar face. |
[in] | modelRef | the model in which the element is created |
MSPSOLID_EXPORT int mdlSolid_pointFromVertex | ( | DPoint3d * | point, |
VERTEX_TAG | vertex | ||
) |
Returns the global coordinates of the point underlying the vertex.
[out] | point | is the coordinates of a vertex. |
[in] | vertex | is the input vertex. |
MSPSOLID_EXPORT int mdlSolid_pointInBody | ( | int * | inBody, |
DPoint3d * | loc, | ||
BODY_TAG | body | ||
) |
The mdlSolid_pointInBody function tests whether a point lies inside,
outside or on the boundary of a given body.
The possible returned values for inBody are POINT_UNKNOWN, POINT_INSIDE, POINT_BOUNDARY and POINT_OUTSIDE.
[out] | inBody | is the returned containment information. |
[in] | loc | is a the test point. |
[in] | body | is the input body. |
MSPSOLID_EXPORT int mdlSolid_rayTestBody | ( | ENTITY_TAG ** | entities, |
double ** | params, | ||
int * | hitsFound, | ||
DPoint3d * | origin, | ||
DPoint3d * | dir, | ||
BODY_TAG | b, | ||
int | hitsWanted, | ||
bool | backupRayOrigin, | ||
DgnModelRefP | modelRef | ||
) |
Fires a ray from origin along dir and finds all entities in the input body that intersect with the ray.
Unlike the mdlSolid_getEntities function, it finds all the entities in its path upto a maximum of hitsWanted entities. The parameter values along the fire ray are returned along with the points of intersection. To return all the hits, set hitsWanted to 0. The priorities for returning different entity types are in the order of vertex, edge and face.
[out] | entities | list of entities found |
[out] | params | parameters along the ray |
[out] | hitsFound | is the number of entities found. |
[in] | origin | is the ray origin. |
[in] | dir | is the ray direction vector. |
[in] | b | is the input body. |
[in] | hitsWanted | is the total number of entities requested. |
[in] | backupRayOrigin | start ray outside of body. If this is TRUE and the starting origin is inside the body, then the origin is moved in a direction opposite to the direction of the ray until it is outside the body and then the ray fired. |
[in] | modelRef | model in which the body is present (or the smartelement from which body is extracted is present) |
MSPSOLID_EXPORT int mdlSolid_rayTestFace | ( | DPoint3dP * | pointPP, |
DPoint2d ** | uvPP, | ||
double ** | rayParamPP, | ||
int * | hitsFoundP, | ||
DPoint3dCP | originP, | ||
DVec3dCP | dirP, | ||
FACE_TAG | face, | ||
double | minRayDistance, | ||
double | maxRayDistance | ||
) |
Fires a ray from origin and along dir and the points of intersection between the ray and the face.
The two paraeters minRayDistance and maxRayDistance determine the portion of the line where the intersections are considered. Only intersection points between distances of minRayDistance and maxRayDistance from the input origin are returned.
[out] | pointPP | the points at which the line intersects the face |
[out] | uvPP | the paraetric coordinates of the face surface at which the line intersects the face |
[out] | rayParamPP | the parameters of the ray line at which the line intersects the face |
[out] | hitsFoundP | the nuber of intersections between the line and the face |
[in] | originP | the origin of the ray |
[in] | dirP | the direction of the ray that is fired |
[in] | face | the face at which the ray is fired |
[in] | minRayDistance | minimum distance at which points of intersection are needed A value of 0.0 indicates all points of intersection from origin to maxRayDistance |
[in] | maxRayDistance | maximum distance beyond which intersections are not needed |
MSPSOLID_EXPORT int mdlSolid_recursiveSewSheetsToElement | ( | MSElementDescrH | ppEdP, |
TAG_ENTITY_LIST * | pSheetList, | ||
MSElementP | templateP, | ||
DgnModelRefP | modelRef, | ||
double | maxTol | ||
) |
The function takes as input a list of sheet bodies and tries to stitch them into a single sheet body.
Then, it creates a MicroStation element for the bodies and returns the element to the user. The returned elements can be further used for display or other purposes as deemed necessary by the calling application.
[out] | ppEdP | output element descriptor |
[in] | pSheetList | input list of bodies. The bodies are consumed. |
[in] | templateP | template element used for creation of the output elements |
[in] | modelRef | modelref of the model that the elements to be created for |
[in] | maxTol | the maximum gap between edges that needd to be considered as coincident |
MSPSOLID_EXPORT int mdlSolid_regulariseEntity | ( | ENTITY_TAG | entity | ) |
The mdlSolid_regulariseEntity function removes all faces,
edges and vertices which are unnecessary for supporting the topology of the given entity.
Double sided faces are removed. An edge is not needed if the surfaces defining the two faces of the edge are the same. Vertices and edges are handled in the same manner. This function only handles the edges or vertices associated with body, lump, shell, face, edge or vertex. For other actions, no action takes place.
[in,out] | entity | is the entity to be regularized. |
MSPSOLID_EXPORT StatusInt mdlSolid_removeBlends | ( | double | blendRadius, |
BODY_TAG | bodyTag | ||
) |
The mdlSolid_removeBlends function removes blend faces from its
owning body.
blendRadius | IN is the blend radius. If a blend face's radius is less than or equal to this value, it will be removed. |
bodyTag | IN is the solid entity that needs to be operated on. |
MSPSOLID_EXPORT int mdlSolid_removeFace | ( | FACE_TAG | f | ) |
The mdlSolid_removeFace function removes a face from its owning
body.
When edges and vertices are no longer needed to support the face, they are removed as well. This differs from mdlSolid_uncoverFace function.
[in,out] | f | is a pointer to the face to be removed. |
MSPSOLID_EXPORT int mdlSolid_removeFaces2 | ( | TAG_ENTITY_LIST * | bodyListP, |
TAG_ENTITY_LIST * | faceListP, | ||
int | healOption, | ||
bool | healLoop | ||
) |
Removes the set of input faces from their owning body.
All the faces input in this list must belong to the same body. The function also takes in parameters to try and heal any wounds that are created due to the removal operation. Wounds are defects in the body that are a result of the face removal operation. An attempt to cure these wounds can be made by passing in the right flags for the third and fourth options. The healOption argument specifies the method to attempt curing. It can take the following values: HEAL_Cap - Cap the wound with a new surface HEAL_Child - Grow the side faces of the child (body after wound) to cure the wound HEAL_Parent - Grow the adjacent faces of the parent (before the wound) to cure the wound HEAL_No - Leave wound as it is. healLoop - This option if set to TRUE makes the loops to be healded independently
[out] | bodyListP | list of resultant bodies. It is possible that the original body is broken into more than one body. |
[in] | faceListP | list of faces to be removed |
[in] | healOption | heal option (one of HEAL_Cap, HEAL_Child, HEAL_Parent or HEAL_No) |
[in] | healLoop | TRUE to heal loops independently and FALSE to do otherwise |
MSPSOLID_EXPORT StatusInt mdlSolid_removeFeatures | ( | double | blendRadius, |
double | holeRadius, | ||
double | tinyArea, | ||
BODY_TAG | bodyTag | ||
) |
The mdlSolid_removeFeatures function removes small features from its
owning body.
blendRadius | IN is the blend radius. If a blend face's radius is less than or equal to this value, it will be removed. |
holeRadius | IN is the hole radius. If a hole's radius is less than or equal to this value, it will be removed. |
tinyArea | IN is the tiny area. If a face's area is less than or equal to this value,it will be removed. |
bodyTag | IN is the solid entity that needs to be operated on. |
MSPSOLID_EXPORT StatusInt mdlSolid_removeHoles | ( | double | holeRadius, |
BODY_TAG | bodyTag | ||
) |
The mdlSolid_removeHoles function removes holes from its
owning body.
holeRadius | IN is the hole radius. If a hole's radius is less than or equal to this value, it will be removed. |
bodyTag | IN is the solid entity that needs to be operated on. |
MSPSOLID_EXPORT StatusInt mdlSolid_removeTinyFaces | ( | double | tinyArea, |
BODY_TAG | bodyTag | ||
) |
The mdlSolid_removeTinyFaces function removes tiny faces from its
owning body.
tinyArea | IN is the tiny area. If a face's area is less than or equal to this value,it will be removed. |
bodyTag | IN is the solid entity that needs to be operated on. |
MSPSOLID_EXPORT void mdlSolid_removeUnfixedBlends | ( | BODY_TAG | body | ) |
Removes the implicit blend attributes from all edges in the body.
This function can be used to removed implicit blend attributes from edges when a call to mdlSolid_fixBlends fails.
[in] | body | the body from which to remove the unfixed edge blends |
MSPSOLID_EXPORT int mdlSolid_reverseBody | ( | BODY_TAG | body | ) |
Reverses the orientations all faces of the body.
[in,out] | body | is the body to be reversed and the reversed body. |
MSPSOLID_EXPORT double mdlSolid_samePointTolerance | ( | ) |
Returns the tolerance set within a .dgn file that
determines whether two points are the same (i.e.
half a UOR) in solids kernel units.
MSPSOLID_EXPORT int mdlSolid_setConstantChamfers | ( | TAG_ENTITY_LIST * | list, |
double | leftRange, | ||
double | rightRange, | ||
double | startSetback, | ||
double | endSetback | ||
) |
Attaches implicit chamfers as attributes to each edge in the list.
The ranges and the setback values are in the local coordinates of the body. The startSetback and the endSetback parameters are either positive or zero. They determine the approximate distance from the blended vertex to where the vertex blend ends. Setbacks are ignored if there are no blended vertices. The sense of left and right is taken from the sequence of entities in the list. Entities whose sense is reversed compared to the list have left and right interchanged. If the list forms a closed sequence, the sense of left and right is taken from the first edge in the list.
[in,out] | list | is a pointer to the entity list to attach chamfer attributes. |
[in] | leftRange | is the left chamfer range. |
[in] | rightRange | is the right chamfer range. |
[in] | startSetback | is the starting setback value. |
[in] | endSetback | is the ending setback value. |
MSPSOLID_EXPORT int mdlSolid_setConstantRounds | ( | TAG_ENTITY_LIST * | list, |
double | radius, | ||
double | startSetback, | ||
double | endSetback | ||
) |
Attaches implicit rounds as attributes to each edge in the list.
The radius and the setback values are in the local coordinates of the body. The startSetback and the endSetback parameters are either positive or zero. They determine the approximate distance from the blended vertex to where the vertex blend ends. Setbacks are ignored if there are no blended vertices.
[in,out] | list | is a pointer to the entity list to attach blending attributes. |
[in] | radius | is the radius for round edge. |
[in] | startSetback | is the starting setback value. |
[in] | endSetback | is the ending setback value. |
MSPSOLID_EXPORT StatusInt mdlSolid_sewBodies | ( | TAG_ENTITY_LIST * | sewnBodyListP, |
TAG_ENTITY_LIST * | unsewnBodyListP, | ||
TAG_ENTITY_LIST * | inputBodyListP, | ||
double | gapTolerance | ||
) |
This function sews or stitches a list of sheet bodies and returns two sets of bodies.
The first list contains a list of bodies that are formed by stitching together two or more bodies from the input list. The second list consists of sheet bodies from the original input body list for which the modeler is unable to find even one body to stitch with.
[out] | sewnBodyListP | list of sewn bodies. Bodies which have been formed by stitching together two or bodies in the original list. |
[in] | unsewnBodyListP | bodies from original input body list which did not have an edge in common with any of the other bodies in the original input list |
[in] | inputBodyListP | input list of bodies. If the operation is successful, the bodies in the list should not be used henceforth as some of them may have been consumed. |
[in] | gapTolerance | maximum distance between edges below which two edges are considered to be same during the stitching process |
MSPSOLID_EXPORT int mdlSolid_sewBodiesRecursively | ( | TAG_ENTITY_LIST * | sheetBodyListP, |
double | minTol, | ||
double | maxTol, | ||
double | mulTol | ||
) |
The function accepts a list of sheet bodies as input and tries to stitch them all together into one are more bodies.
The resultant bodies are returned in the input/output list. The original bodies are deleted. It works in a recursive fashion. It first attempts to stitch together the bodies with minTol (say 1E-6). Then, if it does not produce a single resultant body, then it tries to use a tolerance of 1E-6*mulTol (say 10). It continues in this manner until either maxTol is reached or it obtains a single body as a result. A good set of values for the three parameters are minTol = 1E-6, maxTol=1E-2 and mulTol = 10.
[in,out] | sheetBodyListP | input/output body list |
[in] | minTol | minimum tolerance at which stitching needs to be attempted |
[in] | maxTol | maximum tolerance at which stitching needs to be attempted |
[in] | mulTol | multiplicity factor between two consecutive attempts at stitching |
alinkjoin mdlSolid_sewBodiesRecursively
MSPSOLID_EXPORT int mdlSolid_sheetFromFace | ( | BODY_TAG * | sheetP, |
FACE_TAG | face | ||
) |
Creates a sheet body from a single face.
[out] | sheetP | is the sheet body returned |
[in] | face | is the face from which the sheet body is created. |
MSPSOLID_EXPORT int mdlSolid_sheetFromFaces | ( | BODY_TAG * | sheetP, |
TAG_ENTITY_LIST * | faceListP | ||
) |
Creates a sheet body by joining together the input faces.
All the faces must come from the same body. This is typically used when a solid body needs to be converted to a sheet body. A call to extract all the faces of the solid body followed by a call to this function will create an equivalent sheet body.
[out] | sheetP | is the sheet body created |
[in] | faceListP | is the input list of faces |
MSPSOLID_EXPORT int mdlSolid_shellData | ( | FACE_TAG * | face, |
SHELL_TAG * | next, | ||
SHELL_TAG | s | ||
) |
Returns the first face of the input shell and the next shell
in the lump or NULL if this is the last shell in the lump.
[out] | face | is the first face of the shell. |
[out] | next | is the next shell in the lump. |
[in] | s | is the input shell to get data for. |
MSPSOLID_EXPORT int mdlSolid_shellType | ( | ) |
Returns the SHELL_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT StatusInt mdlSolid_simplifyBody | ( | BODY_TAG * | bodyP, |
bool | local | ||
) |
Attempts to simplify bspline curves and surfaces into analytic curves and surfaces wherever possible.
Using analytic surfaces and curves wherever possible decreases model sizes, is more efficient and increases speed of modeling.
[in,out] | bodyP | input body to be simplified/output simplified body |
[in] | local | flag to indicate whether local simplication needs to be performed. If local is TRUE, then the function will attempt to replace parts of a spline curve or surface. A consequence of this is that edges/faces on the same surface may be on different surfaces/curves after simplification. |
MSPSOLID_EXPORT int mdlSolid_slice | ( | BODY_TAG * | slice, |
BODY_TAG | b1, | ||
BODY_TAG | b2 | ||
) |
Intersects the two input bodies and returns the intersection as a wire body.
Each edge in the returned wire body will have two coedges.
[out] | slice | returns a pointer to the resulting wire body. |
[in] | b1 | is a pointer to the first body. |
[in] | b2 | is a pointer to the second body. |
MSPSOLID_EXPORT int mdlSolid_spinFaces | ( | TAG_ENTITY_LIST * | faceListP, |
DPoint3dP | originP, | ||
DPoint3dP | axisP, | ||
double | angle, | ||
bool | faceFaceCheck | ||
) |
Spins one or more faces belonging to the same solid body around the input axis.
[in] | faceListP | input list of faces |
[in] | originP | origin of axis about which the faces need to be swept |
[in] | axisP | direction of axis |
[in] | angle | angle of sweep |
[in] | faceFaceCheck | flag to indicate whether face-face intersection checks need to be made |
MSPSOLID_EXPORT int mdlSolid_subShellType | ( | ) |
Returns the SUBSHELL_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT int mdlSolid_subtract | ( | BODY_TAG | b2, |
BODY_TAG | b1 | ||
) |
Subtracts b1 from b2 and leaves the result (possibly consisting of a set of disjoint lumps) in b2.
b1 is deleted and should not be used henceforth.
[in,out] | b2 | the resulting body |
[in] | b1 | body to be subtracted from b2 |
MSPSOLID_EXPORT int mdlSolid_sweepBodyAxis | ( | BODY_TAG | body, |
DPoint3dP | revolveAxisP, | ||
DPoint3dP | radialAxisP, | ||
double | angle, | ||
double | shell, | ||
double | draftAngle, | ||
bool | closeOpenProfiles | ||
) |
Revolves a wire or sheet body about the axis passing through the point radialAxisP and along revolveAxisP.
A shell thickness can be applied to by inputting a non-zero value for 'shell'.
[in,out] | body | is the input wire or sheet body to be revolved. This is also the revolved solid body. |
[in] | revolveAxisP | is the direction of the axis of revolution |
[in] | radialAxisP | is a point on the axis |
[in] | angle | is the revolution angle. |
[in] | shell | is the shell thickness applied to the resulting solid. Pass 0.0 if no shell is required. |
[in] | draftAngle | is not used. This parameter is present for legacy reasons only. |
[in] | closeOpenProfiles | input TRUE if open wire profiles are to be closed before they are revolved. |
MSPSOLID_EXPORT int mdlSolid_sweepBodyVector | ( | BODY_TAG | body, |
DPoint3dP | directionP, | ||
double | distance, | ||
double | shell, | ||
double | draft | ||
) |
Sweeps a wire or sheet body a fixed distance along a vector.
An optional shell thickness can also be specified, pass 0.0 for no shell. An optional draft angle can also be specified, pass 0.0 for no draft.
[in,out] | body | is the input wire or sheet body which is swept and returned. |
[in] | directionP | is the direction along which bodyP is swept. |
[in] | distance | is the distance by which bodyP is swept. |
[in] | shell | is the shell thickness of the swept body. Pass 0.0 if shelling is not required. |
[in] | draft | is the draft angle to be applied to the swept body. |
MSPSOLID_EXPORT int mdlSolid_sweepBodyWire | ( | BODY_TAG * | bodyP, |
BODY_TAG | wireBody, | ||
DPoint3d * | pathStartP, | ||
double | shell, | ||
bool | capped, | ||
DgnModelRefP | modelRef | ||
) |
Sweeps an input wire or sheet body along a path represented by wireBodyP.
A shell thickness can also be specified if needed. If capped is TRUE, surfaces that result from sweeping closed profiles are capped and converted to solids.
[in,out] | bodyP | is the input profile body which is swept along the path. |
[in] | wireBody | is the path along which bodyPP is swept. |
[in] | pathStartP | is the starting point for the sweep (in MicroStation 7.0 only). |
[in] | shell | is the shell thickness of the swept body. Pass 0.0 if shelling is not required. |
[in] | capped | if TRUE, will convert surfaces that result from sweeping closed profiles to solids. It should be set to FALSE otherwise. |
[in] | modelRef | model in which the body is present (or the smartelement from which body is extracted is present) |
MSPSOLID_EXPORT int mdlSolid_sweepFaces | ( | TAG_ENTITY_LIST * | faceListP, |
DPoint3dP | translationP, | ||
bool | faceFaceCheck | ||
) |
Sweeps the set of faces belonging to the same body by the input translation vector.
[in] | faceListP | list of faces to be swept |
[in] | translationP | sweep to be performed |
[in] | faceFaceCheck | flag to indicate whether face face checks are performed |
MSPSOLID_EXPORT int mdlSolid_thickenSheetBody | ( | BODY_TAG | body, |
TAG_ENTITY_LIST * | oldFaceListP, | ||
TAG_ENTITY_LIST * | newFaceListP, | ||
double | forwardDist, | ||
double | backwardDist | ||
) |
Thickens the input sheet body into a solid body.
The sheet body is thickened by forwardDist in the direction of face normals and backwardDist opposite to the face normals.
[in,out] | body | input sheet body and output solid body |
[out] | oldFaceListP | list of old faces which were transformed |
[out] | newFaceListP | list of new faces that were obtained as a result of transformation of old faces. Each nth face in this list corresponds to the nth face returned in oldFaceListP. For example, the third faces in this list has been obtained as a result of transformation of the 3rd face in oldFaceListP. |
[in] | forwardDist | distance to be thickened along face normals |
[in] | backwardDist | distance to be thickened opposite to face normals. |
MSPSOLID_EXPORT int mdlSolid_transformFromSurfaceUV | ( | TransformP | transformP, |
TransformP | inverseTransformP, | ||
FACE_TAG | face, | ||
DPoint2d * | uvP, | ||
DgnModelRefP | modelRef | ||
) |
Creates a transformation matrix from a point on the
given face.
The point on the surface corresponds to the given uvP parameter. The x, y, z axes of the rotation matrix for the transformation are defined by the surface normal, u-partial derivative and v- partial derivative at the location point respectively. The translation is given by the location point. The output is in the world coordinate system of the design file, so a modelRef needs to be input.
[out] | transformP | is the transformation matrix. |
[out] | inverseTransformP | is the inverse transformation matrix. |
[in] | face | is the given face. |
[in] | uvP | is the given parameter to evaluate at. |
[in] | modelRef | is the model that contains the surface. |
MSPSOLID_EXPORT StatusInt mdlSolid_trimByEdgesAndFaces | ( | BODY_TAG | body, |
TAG_ENTITY_LIST * | pEdgeList, | ||
TAG_ENTITY_LIST * | pFaceList, | ||
bool | keep | ||
) |
This function trims a sheet body using a set of supplied edges.
The edges provided must divide the body into at least two sets of faces. The face list provided can be used to delete/keep some of the faces that are obtained due to the trim. If keep is TRUE, all the faces in the input face list will be kept. If keep is FALSE, all the faces in the provided list will be deleted.
[in,out] | body | input/output sheet body |
[in] | pFaceList | input face list |
[in] | pEdgeList | input edge list to be used for trimming the sheet |
[in] | keep | flag if TRUE, faces in pFaceList are kept and if FALSE faces in pFaceList are removed |
MSPSOLID_EXPORT int mdlSolid_uncoverFace | ( | FACE_TAG | face | ) |
Removes a face from it's owning sheet body.
Uncovering a face that has edges with only one coedge leaves the edges in the body as dangling sheet edges. The volume of the body will not change in general. Note that the owning body should be a sheet body.
[in,out] | face | face to be uncovered |
MSPSOLID_EXPORT int mdlSolid_unite | ( | BODY_TAG | b2, |
BODY_TAG | b1 | ||
) |
Performs the boolean union operation and leaves the result in b2.
b2 can consist of multiple and possibly disjoint lumps. b1 is deleted and should not be used henceforth.
[in,out] | b2 | the union of the two bodies |
[in] | b1 | body to be united with b2 |
MSPSOLID_EXPORT int mdlSolid_updateBodyNodeId | ( | BODY_TAG | body | ) |
Updates the node ids for the body.
Typically, this needs to be called after a body is manipulated. Consider a solid cube with one blend in it. Now, there are two node in this body. One that represents the creation of the cube and the second that of the blend. Now, when we drill a hole in the solid, there is a new face that is created (the cylindrical face). A call to this function after the drilling operation adds ids (faceId.entityId = 1 and faceId. nodeId = 3) on the cylindrical face.
[in] | body | the body to update node ids for |
MSPSOLID_EXPORT int mdlSolid_vertexData | ( | DPoint3d * | pointP, |
VERTEX_TAG | vertex | ||
) |
Extracts the underlying point from a vertex.
[out] | pointP | is the point returned. |
[in] | vertex | is the vertex. |
MSPSOLID_EXPORT int mdlSolid_vertexFromId | ( | VERTEX_TAG * | vertexP, |
VertexId * | vertexIdP, | ||
BODY_TAG | body | ||
) |
Finds the vertex which has the given vertex id.
[out] | vertexP | returns a pointer to the vertex. |
[in] | vertexIdP | is a pointer to the given vertex id. |
[in] | body | is the body in which to search for the vertex |
MSPSOLID_EXPORT int mdlSolid_vertexType | ( | ) |
Returns the BODY_TYPE constant that can be used as input to
many functions.
MSPSOLID_EXPORT int mdlSolid_wireIsG1 | ( | BODY_TAG | wire | ) |
This function determines whether the input wire body is
G1 continuous (smooth) across all of its vertices.
A wire is G1 continuos at a vertex if the tangents along the wire on either side of the vertex are same in direction.
[in] | wire | is the wire body to be tested for G1 continuity |
MSPSOLID_EXPORT int mdlSolid_wireType | ( | ) |
Returns the WIRE_TYPE constant that can be used as input to
many functions.