Updating to Version 19

The ROSE Math library provides the mesh data structures used by both faceting libraries, but now that IFC4 handles spline surfaces and boundary representations, we have consolidated algorithms used by STEP and IFC into the common math library.

If you include the mesh definitions, you may need to add some support libraries to your link line. The setup instructions have the current list of libraries. In addition, some class and function names have changed as outlined in the table below:

Old Definition New Definition Notes
RoseMeshFacetSet RoseMesh Simplified name for the core mesh class.
rose_mesh_bounds() RoseMesh::applyMeshBounds() or RoseMesh::applyFacetBounds() One function, clear box before calling.
rose_mesh_update_bounds() Same as above
rose_mesh_get_color() RoseMesh::getFaceColor() or RoseMeshFace::getColor() Integrated value into face.
rose_mesh_set_color() RoseMesh::setFaceColor() or RoseMeshFace::setColor() Integrated value into face.

Some of the library functions lacked structure, making them difficult to find. We revised names across STEP, IFC, and ROSE to group them topically in a three level pattern. All functions begin with "stix", "ifcx", or "rose" to identify the layer, followed by a short topic area, like "unit", "xform", or "vec". Finally, the action, like "make", "get" or "find".

Most of the ROSE math functions already followed this convention, but we renamed the unit functions as below. The headers have #defines for the original names, so you do not need to change existing code. To see what needs to change, just disable the old names by defining ROSEMATH_NO_DEPRECATED_NAMES on the compile line or in your code.

#define ROSEMATH_NO_DEPRECATED_NAMES

The original and new names are listed below:

Deprecated Name				Current Name
rose_get_measure_as_unit		rose_unit_convert
rose_get_measure_type			rose_unit_get_measure_type
rose_get_measure_type_name		rose_unit_get_measure_name
rose_get_rational_unit			rose_unit_find_rational
rose_get_unit				rose_unit_find
rose_get_unit_conversion_factor 	rose_unit_get_conversion
rose_get_unit_denominator		rose_unit_get_denominator
rose_get_unit_fullname			rose_unit_get_fullname
rose_get_unit_name			rose_unit_get_name
rose_get_unit_numerator			rose_unit_get_numerator
rose_get_unit_related_by_factor		rose_unit_find_related_by_factor

Updating to Version 17

This ROSE Math library gathers together code that existed in the STEP Tools libraries for STEP, IFC, and other engineering data and then removed depencencies on specific EXPRESS schemas.

The STEP Faceter, IFC Faceter, and STEP helper function libraries now use mesh, transform, bounding box, and unit data types provided by the ROSE Math library. As a result, you will need to change some symbols when updating code that used the earlier definitions.

In most cases, updating older code is just a change from a "Stix" prefix to a "Rose" prefix, as with StixUnit to RoseUnit. In addition to the changes in the table below, you must add the rosemath.lib library to your link line.

Old Definition New Definition Notes

Classes previously in the STEP Facet Library

StixMeshBoundingBox RoseBoundingBox
StixMeshFace RoseMeshFace
StixMeshFaceAtts RoseMeshFaceAtts
StixMeshFaceColor RoseMeshFace::getColor
StixMeshFaceProp RoseProperty
StixMeshFacet RoseMeshFacet The struct members have also changed. The vert_normals array is now called normals and the cached facet_normal value was removed to save space. Use the RoseMesh::getFacetNormal() function to compute the triangle normal.
StixMeshFacetSet RoseMesh
StixMeshTopology RoseMeshTopology
StixMeshTopologyVertexIterator RoseMeshTopologyVertexCursor
StixMeshTopologyWritable RoseMeshTopologyWritable
StixMeshUVBbox RoseBoundingBox2D
StixMeshVec3Array RoseReal3DArray

Classes previously in the STEP Helper Library

StixMtrx RoseXform This class is simply a wrapper around a double[16] that uses the GL conventions for ordering of values. The rose_xform functions take either class or doubles
StixUnit RoseUnit The prefix for enum values is now roseunit_ instead of stixunit_.
StixUnitSet RoseUnitSet
StixValueType RoseMeasureType The prefix for enum values is now rosemeasure_ instead of stixvalue_. Rotational speed is now rosemeasure_ang_speed instead of stixvalue_spinrate. Linear speed is now rosemeasure_speed instead of stixvalue_feedrate.
StixVctr RoseDirection or RosePoint Both classes are simply wrappers around double[3] but have different names to indicate purpose. Most of the rose_vec functions take either class or doubles

Functions and macros that have moved

STIX_EPSILON ROSE_EPSILON
STIX_FLOAT_EQUAL ROSE_FLOAT_IS_EQUAL
STIX_FLOAT_NOT_EQUAL ROSE_FLOAT_NOT_EQUAL
STIX_FLOAT_NOT_NULL ROSE_FLOAT_NOT_NULL
STIX_FLOAT_NOT_ZERO ROSE_FLOAT_NOT_ZERO
STIX_FLOAT_NULL ROSE_FLOAT_IS_NULL
STIX_FLOAT_ZERO ROSE_FLOAT_IS_ZERO
STIX_PI ROSE_PI
STIX_180_OVER_PI ROSE_180_OVER_PI
STIX_PI_OVER_180 ROSE_PI_OVER_180
STIX_PI_OVER_2 ROSE_PI_OVER_2
stix_get_converted_measure rose_get_measure_as_unit
stix_get_unit_conversion_factor rose_get_unit_conversion_factor
stix_get_unit_fullname rose_get_unit_fullname
stix_get_unit_name rose_get_unit_name
stix_get_value_type rose_get_measure_type
stix_get_value_type_name rose_get_measure_type_name
stix_is_epsilon_equal rose_is_epsilon_equal
stix_is_epsilon_nonzero rose_is_epsilon_nonzero
stix_is_epsilon_zero rose_is_epsilon_zero
stix_is_epsilon_zero rose_is_epsilon_zero
stix_make_normalized_matrix stix_xform_putIf you have individual components, you could manually assign them using origin() and put_dirs()
stixmesh_cross_product rose_vec_cross
stixmesh_distance2 rose_pt_distance_sq
stixmesh_distance rose_pt_distance
stixmesh_dot_product rose_vec_dot
stixmesh_get_normal rose_vec_normal_to
stixmesh_magnitude rose_vec_length
stixmesh_nearest_point_on_line2 rose_pt_nearest_on_line_thru_points
stixmesh_nearest_point_on_line rose_pt_nearest_on_line
stixmesh_transform rose_xform_apply
stixmesh_transform_dir rose_xform_apply_dir
stixmesh_vector_diff rose_vec_diff
stixmesh_vector_normalize rose_vec_normalize
stixmesh_vector_scale rose_vec_scale
stixmesh_vector_sum rose_vec_sum

StixMtrx and StixVctr operators

mtrx1 * mtrx2 rose_xform_composeWhen converting matrix multiplication, you must reverse the order of the imputs compose(out, mtrx2, mtrx1)
mtrx * vctr rose_xform_apply or rose_xform_apply_dirUse apply when transformaing a point and apply_dir when transforming a direction vector
vctr1 * vctr2 rose_xform_cross
vctr1 + vctr2 rose_xform_sum
vctr1 - vctr2 rose_xform_diff
- vctr rose_xform_negate
mtrx.genRotation rose_xform_put_rotation The transform created by the StixMtrx was sign flipped. If you make a matrix with a 90deg rotation along Z and then apply it to the X axis, it gave you -Y instead of +Y. rose_xform does the right thing.
StixVctr(stp_cartesian_point *) stix_vec_putThe custom constructors from STEP data and vice-versa are now standalone functions in the stix library
StixVctr(stp_direction *) stix_vec_put
StixVctr(stp_vector *) stix_vec_put
StixVctr(stp_vector *) stix_vec_put
vctr.makeDirIn stix_make_direction
vctr.makePtIn stix_make_cartesian_point
StixMtrx(stp_axis2_placement_3d *) stix_xform_put
StixMtrx(stp CTO 3d *) stix_xform_put
mtrx.makeAp3dIn stix_make_ap3d
mtrx.makeCto3dIn stix_make_cto3d