 |
PK_MESH_create_from_facets_o_t |
|
struct PK_MESH_create_from_facets_o_s
{
int o_t_version; --- Version number of
--- option structure
int vertices_estimate; --- An estimate for the
--- total number of vertices
--- returned by all calls to
--- 'facet_reader'. (0)
int facets_estimate; --- An estimate for the
--- total number of facets
--- returned by all calls to
--- 'facet_reader'. (0)
PK_MESH_facet_f facet_free; --- Function provided by the
--- application to free data
--- returned by 'facet_reader'.
--- (NULL)
PK_MESH_create_t create; --- Whether 'facet_reader' is called
--- immediately or only when the
--- mesh is required.
--- (PK_MESH_create_now_c)
PK_LOGICAL_t have_box; --- Whether box of mesh is provided
--- (PK_LOGICAL_false)
PK_BOX_t box; --- Box of mesh when reading of mesh
--- is delayed.
PK_LOGICAL_t thread_safe; --- Whether the 'facet_reader' and
--- the 'facet_free' callbacks are
--- thread safe (PK_LOGICAL_false)
};
typedef struct PK_MESH_create_from_facets_o_s PK_MESH_create_from_facets_o_t;
This structure contains optional controls for PK_MESH_create_from_facets
Used in:
PK_MESH_create_from_facets
The options provided are:
'vertices_estimate' When positive, an estimate for the total
number of vertices that will be returned
by all calls to 'facet_reader'.
'facets_estimate' When positive, an estimate for the total
number of facets that will be returned by
all calls to 'facet_reader'
'facet_free' When not NULL, is a function provided by
the application that will free the data
returned by 'facet_reader'. 'facet_free'
is called as soon as the application data
has been copied into Parasolid's memory,
before the next call to 'facet_reader'.
When 'facet_free' is NULL, Parasolid will
not attempt to free the memory allocated
by the application for the facet blocks.
'create' When PK_MESH_create_now_c, the
'facet_reader' callback is used to create
the mesh facets during the current call to
PK_MESH_create_from_facets.
When PK_MESH_create_later_c, the
'facet_reader' callback will only be used
to create the facets of the mesh when they
are required. The facets are required for
any geometric queries on the mesh or when
transmitting the mesh. The callback and
its context data may be required more than
once, for example if a part containing the
mesh has been copied. If the callback is
called and the mesh is not created, then
the error PK_ERROR_mesh_not_created is
raised.
The functions PK_PART_receive_meshes and
PK_PARTITION_receive_meshes can be used to
force all the meshes with callbacks, in
parts or partitions, respectively, to be
created.
'have_box' This option indicates whether a
bounding box is being provided in the
option 'box'.
'box' Bounding box of mesh when 'have_box' is
PK_LOGICAL_true. Providing a box
through this option allows Parasolid to avoid
creating the mesh when testing for clashes
between boxes of entities. If the box is not
a bounding box of the mesh, then the mesh will
not be created and an error will be raised.
'thread_safe' Indicates whether the 'facet_reader' callback
and the 'facet_free' callback (if supplied) are
thread safe.
When supplying 'facets_estimate' or 'vertices_estimate' it is recommended
that applications moderately overestimate (by ~20%) the number of vertices
and facets they will need, as the overhead of allocating additional memory
following an underestimate is more significant than the wasted memory of
an overestimate.