Home > User Guide > How ACIS Uses C++
Math Foundation
Using C++ tools, ACIS implements math classes that are the foundation upon which geometry can be built. This geometry is then used to build models. ACIS also implements several functions for performing basic mathematical operations.
Related Math Classes
A complete set of math classes (including the SPAposition class described in section Key Aspects of C++) provides the foundation needed to describe any geometry. This section introduces some of the math foundation classes that have been implemented in ACIS. ACIS laws are a tool that uses the math foundation and extends it even further.
Note: The math foundation is also implemented in Scheme. The Scheme data types and Scheme extensions related to mathematics can be found in online help.
The following list summarizes the main math foundation classes. These classes are described in detail in reference templates in online help.
- SPAposition
- Stores the xyz coordinates of a position and provides methods for accessing them. Positions can not be added.
- SPAvector
- Similar to SPAposition in that it has three coordinate components, x, y, and z. Instances of SPAvector can be added. It also has a method len for returning its magnitude.
- SPAunit_vector
- Similar to SPAvector, but always has a magnitude of 1. Therefore, it has no len method.
- SPAmatrix
- Represents rotation or reflection of models in 3D. This is always 3 X 3. Therefore, it has a determinant of +1 or -1. (The concept of a matrix not limited to 3 X 3 is available through laws.)
- SPAtransf
- Used for rotation, reflection, and translation of a model in 3D. The SPAtransf constructor should not be called directly. Instead, the friend functions rotate_transf, reflect_transf, and translate_transf should be used. They can be combined to make composite transforms through the use of overloaded operators.
- SPApar_pos
- Represents a location in the parametric space of the surface. This is sometimes called parameter position (u,v).
- SPApar_dir
- Represents a change in the surface parameter space (du, dv).
- SPAparameter
- Available for completeness. This is a real number.
- SPAinterval
- Represents a range in R1. This is made up of two values, the low value and the high value, which are real numbers.
- SPAbox
- Defines a region bounded by three pairs of perpendicular planes aligned in the x, y, and z directions. It is like a geometric expedient in that it is a very nice way of expressing a region of interest independent of the complexity of the geometry within the area. Boxes can be expressed as the two SPApositions on the diagonal or as three SPAintervals.
Some other C++ classes related to mathematics include:
- mass_property
- Defines a class for manipulating mass properties.
- moments
- Manipulates generic mass properties.
- SPApar_box
- Defines a bounding box in parameter space by four values of class SPAparameter: low_u, high_u, low_v, high_v.
- SPApar_vec
- Defines a vector (du, dv) in 2D parameter space.
- param_string
- References parameters.
- position_array
- Creates dynamic arrays of positions.
- pt_derivs
- A class to contain a point and up to 4 derivatives.
- surf_normcone
- Provides a return value for normal_cone which returns a cone bounding the surface normal.
- surf_princurv
- Provides the return value for the principle curvature functions, returning two directions and two curvatures for a surface.
- symtensor
- Defines a symmetric 3 X 3 tensor.
- tensor
- Defines a 3 X 3 tensor.
Math Functions
Some of the low level C++ Direct Interface (DI) functions related to mathematics are:
- angle_between
- Gets the angle (in radians) between two vectors or two unit vectors in the range 0 < angle < 2*pi.
- are_parallel
- Determines if two vectors or two unit vectors are parallel within SPAresnor.
- are_perpendicular
- Determines if two vectors or two unit vectors are perpendicular, within SPAresnor.
- distance_to_line
- Determines the distance from a position to a line.
- distance_to_plane
- Determines the distance from a position to a plane.
- distance_to_point
- Determines the distance between two points.
- find_best_pt
- Gets the SPAposition in array of SPApositions that is closest to a given SPAposition.
- get_plane_from_points
- Determines the plane on which an array of positions or three positions lie, if any.
- intersect_line_circle
- Gets the intersections of a line with a circle.
- intersect_line_plane
- Gets the intersection of a line with a plane.
- intersect_plane_plane
- Gets the intersection of two planes.
- is_equal
- Determines if two values (SPApositions, SPAvectors, or SPAunit_vectors) are equal.
- is_greater_than
- Determines if the first value is greater than the second value.
- is_less_than
- Determines if the first value is less than the second value.
- is_negative
- Determines if a value is negative.
- is_on_line
- Determines if a SPAposition is on a line within SPAresabs.
- is_on_plane
- Determines if a SPAposition is on a plane within SPAresabs.
- is_positive
- Determines if a value is positive.
- is_zero
- Determines if a value, position, vector, or unit vector is zero relative to SPAresabs.
- is_zero_mch
- Determines if a value is zero relative to SPAresmch.
- is_zero_nor
- Determines if a value is zero relative to SPAresnor.
[Top]
© 1989-2007 Spatial Corp., a Dassault Systèmes company. All rights reserved.