Facet Model Structure   

<<< Overview Of Convergent Modeling Chapters Converting Between Facet and Classic Geometry >>>

Contents

[back to top]


83.1 Introduction

In order to facilitate the representation, creation, and manipulation of facet bodies, Parasolid defines a number of major entity classes in addition to those that are used for classic bodies. This chapter discusses these additional entity classes and provides an overview of their use.

Parasolid topology should be used in a facet model as it would be in a B-rep model.

When Convergent Modeling is enabled, the following types of geometric entities can be used instead of classic geometric entities:

These entities should be present in all facet bodies instead of classic geometric entities, and can be used in many Parasolid API functions.

For a complete description of the topological and geometric entities used by Parasolid, see Chapter 14, “Model Structure”, in the Parasolid Functional Description.

[back to top]


83.2 Facet bodies

A facet body is a body with Parasolid topology that references facet geometry instead of classic geometry. A body can contain all facet geometry, all classic geometry, or a combination of both classic and facet geometry. Parasolid provides its own native mesh format called Persistent Mesh (PSM) format for your use.When transmitting facet parts, the PSM mesh data may be embedded in the XT data or saved in a separate .xmm_bin or .xmm_txt file using the same key as the XT file. When receiving facet parts, these files will be required to load the PSM mesh data and should use the same key as the XT part being received. Parasolid will delay loading mesh data until it is required by the operations it is performing. See Section 82.2, “How to make use of Convergent Modeling in Parasolid” for more information on using Convergent Modeling.

 

Figure 83-1 Examples of facet bodies

[back to top]


83.3 Meshes

A mesh (PK_CLASS_mesh) is a sub-class of surface and it contains mesh data in the PSM format, which may be embedded in the XT data or stored externally in a separate .xmm file with the same key. In a facet model, meshes can be attached to rubber faces, and topology-based Parasolid operations treat that mesh as if it was a classic surface. In addition, meshes can be left unattached and geometry-based Parasolid operations (such as intersection) treat them as if they were orphan geometry. We recommend that applications treat meshes in the same manner as they would for any other surface type.

You can create one mesh per face and operations trim meshes to fit the faces they are attached to. When a mesh is created and attached to a body, we recommend adding topology that is appropriate for the body’s shape in order to help optimise downstream modelling operations. Mesh bodies can be split up into separate faces using, for example, PK_FACE_imprint_curves_2. See Section 50.3, “Direct imprinting” for more information.

Parasolid has been designed to deal with large data sets. In addition, large models can be subdivided into regions by using Parasolid topology to capture significant features of the body. This allows operations to restrict the scope of editing operations and make use of boxes to avoid loading distant meshes that are not relevant to the operation. In Figure 83-2, for example, only the red, green and blue meshes need to be edited as a result of subtracting the meshed cylinder from the block. Grey meshes do not need to be edited because they have not been changed by the operation.

 

Figure 83-2 Editing meshes for only changed faces

Parasolid’s meshes are optimised to not load their mesh data until it is needed for an operation. You can force Parasolid to load all PSM data for an array of parts specified or for a given partition using either PK_PART_receive_meshes or PK_PARTITION_receive_meshes. See Section 100.5.1.1, “Receiving mesh data and deltas in a partition” for more information.

Parasolid supports the following mesh-specific operations:

 

Functional area

Example functions

Convert Parasolid body to facet body

PK_BODY_make_facet_body

See Section 84.3, “Creating facet bodies directly from existing bodies” for more information.

Create facet body from mesh data

PK_MESH_make_bodies

See Section 84.4, “Manipulating facet data” for more information.

Create mesh from a selection of mesh topologies from an existing mesh

PK_MTOPOL_make_meshes

See Section 84.4.2, “Creating meshes from mesh topology” for more information on this function.

Data structure and geometric enquiries

PK_MFACET_parameterise_vec, PK_MESH_eval_with_mtopol, PK_MVERTEX_set_positions

See Section 83.5.1, “Mesh topology-specific operationsDOC1914” for a list of mesh topology-specific enquiry functions.

Force loading of meshes

PK_PART_receive_meshes, PK_PARTITION_receive_meshes

Imprint an array of vectors on to a mesh

PK_MESH_imprint_vectors

You can also find a bounding box for a mesh using PK_SURF_find_box.

[back to top]


83.4 Polylines

A polyline (PK_CLASS_pline) is a type of curve that describes a connected chain of linear segments. Unlike meshes, the polyline’s data is stored in the polyline entity itself.

You can create a polyline using PK_PLINE_create. When a polyline is attached to an edge, each point will correspond to a mesh vertex along the boundary of every adjacent mesh face. See the documentation for PK_PLINE_sf_t for more information on creating polylines from the standard form.

In a facet model, polylines can be attached to rubber edges, and topology-based Parasolid operations treat that polyline as if it was a classic curve. Polyline data can be used in the same areas of Parasolid functionality as mesh data.

Polylines can also be left unattached. In this case, they are treated as orphan geometry, and Parasolid supports geometrical operations (such as intersection) upon them as it would orphan geometry in a classic model.

You can also find a bounding box for a polyline using PK_CURVE_find_box.

[back to top]


83.5 Mesh topology

Parasolid defines several classes to let you represent and manipulate the topological entities of these stored meshes in a modelling session. This section describes those entities.

Parasolid defines the following classes for representing mesh topology:

 

Class

Description

Mesh facet

An mfacet (PK_CLASS_mfacet) represents a single triangular facet in a mesh.

Mesh fin

An mfin (PK_CLASS_mfin) represents a fin on a facet boundary.

Mesh vertex

An mvertex (PK_CLASS_mvertex) represents a vertex on a facet.

Mesh topology

An mtopol (PK_CLASS_mtopol) represents any mesh topology entity.

These classes are illustrated in Figure 83-3, together with equivalent topological classes from a classic body. Mesh fins and mesh vertices, in particular, are distinct from Parasolid fins and vertices.

 

Figure 83-3 Mesh topology on a facet body

 

Note: You can use PK_MTOPOL_null_m to create a null PK_MTOPOL_t and PK_MTOPOL_is_null_m to check if a given mtopol is null. See the PK Interface Programming Reference Manual for more information.

Figure 83-4 illustrates the relationship between mesh topologies and Parasolid entities.

 

Figure 83-4 Relationship between mesh topologies and Parasolid entities

83.5.1 Mesh topology-specific operations

Parasolid provides the following functions for enquiring about the mesh topology in a facet body:

 

Function

Description

PK_FIN_find_mtopols

Returns the mtopology of a given fin. See Section 88.5, “Finding the mtopology along a fin” for more information.

PK_MESH_ask_n_mfacets

Returns the number of mfacets in a mesh.

PK_MESH_ask_n_mvertices

Returns the number of mvertices in a mesh.

PK_MESH_eval_with_mtopol

Returns the position, the mfacet and the mtopol at a given uv position in a mesh.

PK_MESH_find_laminar_mfins

Finds and returns the laminar mfins in a mesh. See Chapter 87, “Filling Holes In Facet Bodies” for more information.

PK_MESH_find_sharp_mfins

Finds and returns the sharp mfins in a mesh. See Section 88.3.2.3, “Finding sharp mvertices in meshes” for more information.

PK_MESH_find_sharp_mvxs

Find and returns the sharp mvertices in a mesh. See Section 88.3.2.3, “Finding sharp mvertices in meshes” for more information.

PK_MESH_is_loaded

Returns whether the given mesh is loaded in the current Parasolid session.

PK_MFACET_ask_mfacet_adjacent

Returns the mfacet adjacent to the given mfacet and a specified mfin. For a laminar mfin, returns a zero identifier, indicating that there is no adjacent mfacet.

PK_MFACET_ask_mfin

Returns the mfin of the mfacet with the given mfin_index.

PK_MFACET_ask_mvertices

Returns the mvertices of the given mfacet.

PK_MFACET_ask_mvx_normals

Returns the normals of the mvertices of the given mfacet.

PK_MFACET_ask_normal

Returns the normal vector of the given mfacet.

PK_MFACET_ask_positions

Returns the positions of the mvertices of the given mfacet.

PK_MFACET_parameterise_vec

Finds the mesh parameterisation of a position on a given mfacet.

PK_MFIN_ask_mfacet

Returns the mfacet that contains the mfin.

PK_MFIN_ask_mfin_adjacent

Returns the mfin coincident with the given mfin in the adjacent facet.

PK_MFIN_ask_mfin_index

Returns the index of the given mfin in its mfacet.

PK_MFIN_ask_mvertex

Returns the mvertex pointed to by the given mfin.

PK_MFIN_ask_mvx_normal

Returns the normal of the mvertex of the given mfin.

PK_MFIN_ask_next_in_mfacet

Returns the next mfin in the given mfacet.

PK_MFIN_ask_next_of_mvertex

Returns the next mfin around the given mvertex.

PK_MFIN_ask_previous_in_mfacet

Returns the previous mfin in the given mfacet.

PK_MFIN_ask_previous_of_mvertex

Returns the previous mfin around the given mvertex.

PK_MFIN_is_laminar

Indicates whether the mfin is laminar.

PK_MFIN_is_same_mfacet

Indicates whether the two mfins belong to the same mfacet.

PK_MFIN_is_sharp

Indicates whether the mfin is sharp.

PK_MTOPOL_ask_box

Returns the bounding box for the given mtopol.

PK_MTOPOL_ask_class

Returns the class of an element of mesh topology.

PK_MTOPOL_is

Indicates whether the given mtopol is valid mtopol element.

PK_MTOPOL_make_meshes

Create meshes from a selection of mesh topologies on existing meshes

PK_MVERTEX_ask_normals

Returns all the unique normals of the given mvertex.

PK_MVERTEX_ask_mfacets

Returns all the mfacets that use the given mvertex as one of their mvertices.

PK_MVERTEX_ask_mfin

Returns an mfin which points to the given mvertex.

PK_MVERTEX_ask_mvertices_ring

Returns the ring of mvertices around the given mvertex.

PK_MVERTEX_ask_position

Returns the position at the given mvertex.

PK_MVERTEX_is_laminar

Returns whether the mvertex is on the laminar boundary of the mesh.

For examples of enquiries on mesh topologies, see the code example in the C++\Code Examples\Facet Examples\Mtopols folder, located in example_applications in your Parasolid installation folder.

 

[back to top]

<<< Overview Of Convergent Modeling Chapters Converting Between Facet and Classic Geometry >>>