The 3D ACIS® Modeler (ACIS) is Spatial’s prominent 3D solid modeling engine. 3D InterOp is a CAD data translation framework (Interoperability)

HowTo:Determine if two planes are equivalent?

From DocR19

Jump to: navigation, search

A plane is determined by its normal vector and a point on the plane with this information, one can write an equation which is true for a point if and only if it is on the plane: such an equation is

(x -a) n_1 +(y-b) n_2 +(z-c) n_3 =0\,\!

where

(x,y,z)\,\! is the test point,
(a,b,c)\,\! is the base point (which could be any point on the plane), and
(n_1,n_2, n_3)\,\! is the normal vector.

Given two such equations, one can test if they describe the same plane in two steps: first check that the normal vectors are parallel (in ACIS this can be done using parallel); then check that each base point lies on the opposite plane.

The parallel function will return false for antiparallel vectors; therefore this method will distinguish between planes with opposing normals. The parallel function uses a default tolerance of SPAresnor; this tolerance means that the distance between two planes with normals regarded as parallel will vary by less than SPAresabs over a region the size of the maximum supported model size.


Header Files

#include "pladef.hxx"
#include "vector.hxx"

Example

logical same_planes = FALSE;
plane* pl1 = some_plane;
plane* pl2 = some_other_plane;
if ( parallel( pl1->normal, pl2->normal ) )
    same_planes = fabs( (pl2->root_point - pl1->root_point) % pl1->normal ) < SPAresabs;

Related Content

See also: :Category:FAQs and HowTo:Get the distance from a point to a plane?
Personal tools