Rhino C++ API  8.6
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
ON_Symmetry Class Reference

#include <opennurbs_symmetry.h>

Public Types

enum  : unsigned int { MaximumOrder = 4096 }
 
enum  Coordinates : unsigned char { Coordinates::Unset = 0, Coordinates::Object = 1, Coordinates::World = 2 }
 
enum  Region : unsigned char {
  Region::Unset = 0, Region::AboveReflectionPlane = 1, Region::OnReflectionPlane = 2, Region::BelowReflectionPlane = 3,
  Region::CrossesReflectionPlane = 4, Region::OnRotationAxis = 5, Region::OffRotationAxis = 6, Region::OnReflectionHalfPlane = 7,
  Region::OnSupplementalHalfPlane = 8, Region::OnRotateAndReflectHalfPlane = 10, Region::InsideRotateAndReflect = 11, Region::OutsideRotateAndReflect = 12
}
 ON_Symmetry::Region specifies various subsets of the primary motif region. More...
 
enum  Type : unsigned char {
  Type::Unset = 0, Type::Reflect = 1, Type::Rotate = 2, Type::ReflectAndRotate = 3,
  Type::Inversion = 4, Type::Cyclic = 5
}
 

Public Member Functions

 ON_Symmetry ()=default
 
 ON_Symmetry (const ON_Symmetry &)=default
 
 ~ON_Symmetry ()=default
 
double CleanupTolerance () const
 
void Clear ()
 
void ClearSymmetricObject () const
 
unsigned int CyclicOrder () const
 
const ON_Xform CyclicTransformation () const
 
void Dump (class ON_TextLog &) const
 
const ON_PlaneEquation FixedPlane () const
 
unsigned GetMotifTransformations (bool bIncludeIdentity, ON_SimpleArray< ON_Xform > &motif_transformations) const
 
const ON_SHA1_Hash Hash () const
 
unsigned int InversionOrder () const
 
const ON_Xform InversionTransformation () const
 
bool IsFixedSubDComponent (const class ON_SubDComponentPtr &subd_component, bool bUseCleanupTolerance) const
 
bool IsMotifBoundarySubDVertex (const class ON_SubDVertex *v, bool bUseCleanupTolerance) const
 
bool IsReflect () const
 
bool IsReflectAndRotate () const
 
bool IsRotate () const
 
bool IsSet () const
 
bool IsUnset () const
 
unsigned int MotifCount () const
 
const ON_Xform MotifTransformation (int index) const
 
bool OnReflectAndRotateFixedPlane (ON_3dPoint P, bool bUseCleanupTolerance) const
 
ON_Symmetryoperator= (const ON_Symmetry &)=default
 
ON_Symmetry::Region PointRegion (ON_3dPoint point, bool bUseCleanupTolerance) const
 
bool Read (class ON_BinaryArchive &)
 
const ON_PlaneEquation ReflectAndRotatePlane (unsigned int plane_index) const
 
const ON_PlaneEquation ReflectionPlane () const
 
const ON_Xform ReflectionTransformation () const
 
double RotationAngleDegrees () const
 
double RotationAngleRadians () const
 
const ON_Line RotationAxis () const
 
const ON_3dVector RotationAxisDirection () const
 
const ON_3dPoint RotationAxisPoint () const
 
const ON_3dVector RotationAxisTangent () const
 
unsigned int RotationCount () const
 
const ON_Xform RotationTransformation () const
 
bool SameSymmetricObjectGeometry (const class ON_SubD *subd) const
 
bool SameSymmetricObjectGeometry (const class ON_SubDimple *subdimple) const
 
bool SameSymmetricObjectTopology (const class ON_SubD *subd) const
 
bool SameSymmetricObjectTopology (const class ON_SubDimple *subdimple) const
 
void SetCleanupTolerance (double cleanup_tolerance)
 
bool SetSymmetricObject (const class ON_SubD *subd) const
 
bool SetSymmetricObject (const class ON_SubDimple *subdimple) const
 
ON_Symmetry::Coordinates SymmetryCoordinates () const
 
const ON_SHA1_Hash SymmetryHash () const
 
const ON_UUID SymmetryId () const
 
ON_Symmetry::Type SymmetryType () const
 
double Tolerance (bool bUseCleanupTolerance) const
 
void ToText (bool bIncludeSymmetricObject, class ON_TextLog &text_log) const
 
const ON_Symmetry TransformConditionally (const ON_Xform &xform) const
 
const ON_Symmetry TransformUnconditionally (const ON_Xform &xform) const
 
bool Write (class ON_BinaryArchive &) const
 

Static Public Member Functions

static int Compare (const ON_Symmetry *lhs, const ON_Symmetry *rhs)
 
static int CompareSymmetryTransformation (const ON_Symmetry *lhs, const ON_Symmetry *rhs, double zero_tolerance)
 
static const ON_Symmetry CreateReflectAndRotateSymmetry (ON_PlaneEquation reflection_plane, ON_Line rotation_axis, unsigned int rotation_count, ON_Symmetry::Coordinates symmetry_coordinates)
 
static const ON_Symmetry CreateReflectSymmetry (ON_PlaneEquation reflection_plane, ON_Symmetry::Coordinates symmetry_coordinates)
 
static const ON_Symmetry CreateRotateSymmetry (ON_Line rotation_axis, unsigned int rotation_count, ON_Symmetry::Coordinates symmetry_coordinates)
 
static bool IsValidCyclicTranformation (ON_Xform transformation, unsigned transformation_order)
 
static bool IsValidFixedPlane (ON_Xform transformation, ON_PlaneEquation fixed_plane)
 
static bool IsValidReflectionTranformationAndFixedPlane (ON_Xform reflection, ON_PlaneEquation reflection_plane)
 
static bool IsValidRotationAxis (ON_Line rotation_axis, unsigned int rotation_count)
 
static bool IsValidRotationAxisAndFixedPlane (ON_Line rotation_axis, unsigned int rotation_count, ON_PlaneEquation fixed_plane)
 
static ON_Symmetry::Coordinates SymmetryCoordinatesFromUnsigned (unsigned int coordinates_as_unsigned)
 
static const ON_wString SymmetryCoordinatesToString (ON_Symmetry::Coordinates symmetry_coordinates)
 
static ON_Symmetry::Region SymmetryRegionFromUnsigned (unsigned int region_as_unsigned)
 
static bool SymmetryRegionHasFixedPoints (ON_Symmetry::Region symmetry_region)
 
static ON_Symmetry::Type SymmetryTypeFromUnsigned (unsigned int symmetry_type_as_unsigned)
 
static const ON_wString SymmetryTypeToString (ON_Symmetry::Type symmetry_type)
 

Static Public Attributes

static const ON_UUID ReflectAndRotateId
 
static const ON_UUID ReflectId
 
static const ON_UUID RotateId
 
static const ON_Symmetry Unset
 
static const double ZeroTolerance
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org. ON_Symmetry

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned int
Enumerator
MaximumOrder 

◆ Coordinates

enum ON_Symmetry::Coordinates : unsigned char
strong
Enumerator
Unset 
Object 

The symmetry is associated with an object is is applied to. If that object is transformed, the symmetry's planes and rotation axes are also transformed.

World 

The symmetry is independent of any objects is it applied to. The symmetry's planes and rotation axes are not changed when any of those objects are transformed.

◆ Region

enum ON_Symmetry::Region : unsigned char
strong

ON_Symmetry::Region specifies various subsets of the primary motif region.

Enumerator
Unset 

Unset or unknown location

AboveReflectionPlane 

Above the reflection plane and inside the primary reflect motif region. Applies to Reflect symmetries.

OnReflectionPlane 

On the reflection plane. Applies to Reflect symmetries.

BelowReflectionPlane 

Below the reflection plane and outside the primary reflect motif region. Applies to Reflect symmetries.

CrossesReflectionPlane 

Something like a line segment that has points above and below the reflection plane.

OnRotationAxis 

On the rotation axis. Applies to Rotate and ReflectAndRotate symmetries.

OffRotationAxis 

Off of (not on) the rotation axis. Applies to Rotate symmetries.

OnReflectionHalfPlane 

On the reflection half plane. Applies to ReflectAndRotate symmetries.

OnSupplementalHalfPlane 

On the supplemental half plane. Applies to ReflectAndRotate symmetries.

OnRotateAndReflectHalfPlane 

The half planes outside the primary motif region that are rotations of either the reflection half plane or the supplemental half plane. Applies to ReflectAndRotate symmetries.

InsideRotateAndReflect 

Above both the reflection plane and the supplemental plane. Applies to ReflectAndRotate symmetries.

OutsideRotateAndReflect 

Outside the primary motif region and and on one of the fixed point planes Applies to ReflectAndRotate symmetries.

◆ Type

enum ON_Symmetry::Type : unsigned char
strong

NOTE never use the value 113 for a new ON_Symmetry::Type. This value was used briefly in June 2021 for a prototype symmetry type and reusing it will break SHA1 hashes and 3dm archive IO.

Enumerator
Unset 
Reflect 

Reflection about a plane. The symmetric object has 2 copies of the motif. Points on the reflection plane are fixed.

Rotate 

Rotation around an axis. The symmetric object has rotated copies of the motif. Points on the rotation axis are fixed.

ReflectAndRotate 

Reflection and rotation alternate. Rotation angle is 360/N degrees The symmetric object has 2N copies of the motif. Points on the rotation axis are fixed.

Inversion 

General case inversion symmetry. (inversion transformation)^2 = identity. Det(inversion transformation) = -1. The symmetric object has 2 copies of the motif.

Cyclic 

General case cyclic symmtry (order >= 2) (cyclic transformation)^N = identity. When N is 2 or odd, Det(cyclic transformation) = 1. When N is even and greater than 2, Det(cyclic transformation) = 1 or -1. The symmetric object has N copies of the motif.

Constructor & Destructor Documentation

◆ ON_Symmetry() [1/2]

ON_Symmetry::ON_Symmetry ( )
default

◆ ~ON_Symmetry()

ON_Symmetry::~ON_Symmetry ( )
default

◆ ON_Symmetry() [2/2]

ON_Symmetry::ON_Symmetry ( const ON_Symmetry )
default

Member Function Documentation

◆ CleanupTolerance()

double ON_Symmetry::CleanupTolerance ( ) const

Description: Cleanup tolerance is a 3d world unt length used to preprocess input when creating symmetric objects. For example, in a relfect symmetry, cleanup tolerance would be used to move vertices near the reflection plane to be on the reflection plane. This tolerance is context sensitive. In the same model it could vary between two different input objects. The value is saved with the symmetry so calculations driven by modifying an input object can be repeated using the same cleanup tolerance. Returns: The cleanup tolerance for this specific symmetry. It is always >= ON_Symmetry::ZeroTolerance. The default is ON_Symmetry::ZeroTolerance.

◆ Clear()

void ON_Symmetry::Clear ( )

Description: Set this instance to ON_Symmetry::Unset.

◆ ClearSymmetricObject()

void ON_Symmetry::ClearSymmetricObject ( ) const

Description: Clears the symmetric object geometry and topology hashes.

◆ Compare()

static int ON_Symmetry::Compare ( const ON_Symmetry lhs,
const ON_Symmetry rhs 
)
static

Returns: 0 if lhs and rhs define identical symmetries (types and transformations). Remarks: The symmtric object information is not compared.

◆ CompareSymmetryTransformation()

static int ON_Symmetry::CompareSymmetryTransformation ( const ON_Symmetry lhs,
const ON_Symmetry rhs,
double  zero_tolerance 
)
static

Returns: 0 if the symmetry transformations are the same to tolerance. Otherwise returns ON_Symmetry::Compare(lhs,rhs).

◆ CreateReflectAndRotateSymmetry()

static const ON_Symmetry ON_Symmetry::CreateReflectAndRotateSymmetry ( ON_PlaneEquation  reflection_plane,
ON_Line  rotation_axis,
unsigned int  rotation_count,
ON_Symmetry::Coordinates  symmetry_coordinates 
)
static

Description: Reflection and rotation alternate. The symmetric object has 2*reflection copies of the motif. Points on the rotation axis are fixed.
Parameters: reflection_plane - [in] rotation_axis - [in] A line in the reflection plane. rotation_count - [in] rotation_count must be >= 2 and the rotation angle is (360/rotation_count) degrees. symmetry_coordinates - [in] object or world. Example: If the reflection_plane is the y-z plane, the rotation axis is the z-axis, and rotation_count = 2, then (x,y,z) -> (-x,y,z) -> (-x-y,z) -> (x,-y,z) -> (x,y,z). Remarks: InversionTransformation() = reflection. CyclicTransformation() = rotation by (360/rotation_count) degrees.

◆ CreateReflectSymmetry()

static const ON_Symmetry ON_Symmetry::CreateReflectSymmetry ( ON_PlaneEquation  reflection_plane,
ON_Symmetry::Coordinates  symmetry_coordinates 
)
static

Description: Reflection about a plane. The symmetric object has 2 copies of the motif. Points on the reflection plane are fixed. Parameters: reflection_plane - [in] A point P is in the primary motif when reflection_plane.ValueAt(P) >= 0. symmetry_coordinates - [in] object or world. Example: If the reflection_plane is the y-z plane, then (x,y,z) -> (-x,y,z) -> (x,y,z). Remarks: InversionTransformation() = reflection. CyclicTransformation() = identity.

◆ CreateRotateSymmetry()

static const ON_Symmetry ON_Symmetry::CreateRotateSymmetry ( ON_Line  rotation_axis,
unsigned int  rotation_count,
ON_Symmetry::Coordinates  symmetry_coordinates 
)
static

Description: Rotation around an axis. The symmetric object has reflection_count copies of the motif. Points on the axis are fixed. Parameters: rotation_axis - [in] rotation_count - [in] rotation_count must be >= 2 and the rotation angle is (360/rotation_count) degrees. symmetry_coordinates - [in] object or world. Example: If the rotation axis is the z-axis and the order is N, then the generator is then (x,y,z) -> (r*cos(a), r*sin(a), z) -> (r*cos(2*a), r*sin(2*a), z) -> ... -> (x,y,z), where r = sqrt(x*x + y*y) and a = (360 degrees)/N. Remarks: CyclicTransformation() = rotation. InversionTransformation() = identity.

◆ CyclicOrder()

unsigned int ON_Symmetry::CyclicOrder ( ) const

Returns: 0: unset symmetry 1: the cyclic transformation is the identity. N >= 2: CyclicTransformation()^N = idenity and CyclicTransform()^i != idenity when 0 < i < N. Remarks: In common cases, CyclicTransformation() is either the identity or a rotation.

◆ CyclicTransformation()

const ON_Xform ON_Symmetry::CyclicTransformation ( ) const

Returns: The cyclic transformation is returned. CyclicTransformation()^CyclicOrder() = identity. Remarks: In common cases, CyclicTransformation() is either the identity or a rotation. Remarks: NOTE: A symmetry with SymmetryOrder() = 2 and transformation S can be represented as either InversionTransformation() = S and CyclicTransformation() = identity or or CyclicTransformation() = S and InversionTransformation() = idenity. The convention is to use the cyclic transforms when S is a 180 rotations and inversion transforms otherwise.

◆ Dump()

void ON_Symmetry::Dump ( class ON_TextLog ) const

◆ FixedPlane()

const ON_PlaneEquation ON_Symmetry::FixedPlane ( ) const

Returns: A plane containing all the fixed points of the symmetry. When the symmetry type is Reflect, FixedPlane() = ReflectionPlane(). When the symmetry type is Rotate, FixedPlane() contains the axis of rotation and defines the zero angle. When the symmetry type is ReflectAndRotate, FixedPlane() = ReflectionPlane().

◆ GetMotifTransformations()

unsigned ON_Symmetry::GetMotifTransformations ( bool  bIncludeIdentity,
ON_SimpleArray< ON_Xform > &  motif_transformations 
) const

Description: Get the set of motif transformations that maps the starting motif to the copies. Parameters: bIncludeIdentity - [in] If true, then motif_transformations[0] = identity and MotifCount() transformations are returned. Otherwise, motif_transformations[0] = MotifeTransformation(1) and (MotifCount() -1) transformations are returned. motif_transformations[] - out motif transformations are returned here. Returns: MotifCount().

◆ Hash()

const ON_SHA1_Hash ON_Symmetry::Hash ( ) const

Returns: A SHA1 hash uniquely identifying the symmetry

◆ InversionOrder()

unsigned int ON_Symmetry::InversionOrder ( ) const

Returns: 0: unset symmetry 1: InversionTransformation() = identity 2: InversionTransformation()^2 = identity and InversionTransform() != identity Remarks: In common cases, InversionTransformation() is either the identity or a reflection.

◆ InversionTransformation()

const ON_Xform ON_Symmetry::InversionTransformation ( ) const

Returns: The inversion transformation is returned. InversionTransformation()^InversionOrder() = identity. Remarks: In common cases, InversionTransformation() is either the identity or a reflection (mirror). Remarks: NOTE: A symmetry with SymmetryOrder() = 2 and transformation S can be represented as either InversionTransformation() = S and CyclicTransformation() = identity or or CyclicTransformation() = S and InversionTransformation() = idenity. The convention is to use the cyclic transforms when S is a 180 rotations and inversion transforms otherwise.

◆ IsFixedSubDComponent()

bool ON_Symmetry::IsFixedSubDComponent ( const class ON_SubDComponentPtr subd_component,
bool  bUseCleanupTolerance 
) const

Description: Examples of fixed SubD components include vertices on a reflection plane or rotation axis, faces and edges straddling a reflection plane, and faces centered about a rotation axis. Returns: True if the component is transformed to itself by every motif transformation.

◆ IsMotifBoundarySubDVertex()

bool ON_Symmetry::IsMotifBoundarySubDVertex ( const class ON_SubDVertex v,
bool  bUseCleanupTolerance 
) const

Parameters: v - [in] vertex to test bUseCleanupTolerance - [in] The tolerance used to determine if a point is On an axis or plane is bUseCleanupTolerance ? this->CleanupTolerance() : ON_Symmetry::ZeroTolerance. When in doubt, pass false. Returns: True if v is a vertex that might possibly be merged when transformed motifs are joined to create a symmetric SubD.

◆ IsReflect()

bool ON_Symmetry::IsReflect ( ) const

◆ IsReflectAndRotate()

bool ON_Symmetry::IsReflectAndRotate ( ) const

Returns: True if SymmetryType() is ON_Symmetry::Type::ReflectAndRotage

◆ IsRotate()

bool ON_Symmetry::IsRotate ( ) const

◆ IsSet()

bool ON_Symmetry::IsSet ( ) const

Rturns: True if this instance is set to a symmetry.

◆ IsUnset()

bool ON_Symmetry::IsUnset ( ) const

Rturns: True if this instance is not set.

◆ IsValidCyclicTranformation()

static bool ON_Symmetry::IsValidCyclicTranformation ( ON_Xform  transformation,
unsigned  transformation_order 
)
static

Description: Test a cyclic transformation to make sure it is stable enough to be used in an ON_Symmetry. Parameters: transformation - [in] transformation_order - [in] Returns: True if these 2 conditions are satisfied.

  1. identity = transformation^transformation_order.
  2. identity != transformation^i for 1 <= i < transformation_order. Remarks: The value ON_Symmetry::ZeroTolerance is used for all "zero tolerances."

◆ IsValidFixedPlane()

static bool ON_Symmetry::IsValidFixedPlane ( ON_Xform  transformation,
ON_PlaneEquation  fixed_plane 
)
static

Description: Test a transformation and transformation to make sure the transformation fixes points on the plane. Parameters: transformation - [in] fixed_plane - [in] Returns: True if the the transformation and fixed_plane are valid and the transformation fixes points on the plane. Remarks: The value ON_Symmetry::ZeroTolerance is used for all "zero tolerances."

◆ IsValidReflectionTranformationAndFixedPlane()

static bool ON_Symmetry::IsValidReflectionTranformationAndFixedPlane ( ON_Xform  reflection,
ON_PlaneEquation  reflection_plane 
)
static

Description: Test a transformation and reflection plane. Parameters: reflection - [in] reflection_plane - [in] Returns: True if these 3 conditions are satisfied.

  1. identity = reflection^2
  2. identity != reflection
  3. Points on the reflection_plane are fixed.

◆ IsValidRotationAxis()

static bool ON_Symmetry::IsValidRotationAxis ( ON_Line  rotation_axis,
unsigned int  rotation_count 
)
static

Parameters: rotation_axis - [in] rotation_count - [in] fixed_plane - [in] Returns: True if these 3 conditions are satisfied.

  1. rotation_axis is a valid line.
  2. rotation_count >= 2
  3. rotation_count <= ON_Symmetry::MaximumOrder Remarks: The value ON_Symmetry::ZeroTolerance is used for all "zero tolerances."

◆ IsValidRotationAxisAndFixedPlane()

static bool ON_Symmetry::IsValidRotationAxisAndFixedPlane ( ON_Line  rotation_axis,
unsigned int  rotation_count,
ON_PlaneEquation  fixed_plane 
)
static

Parameters: rotation_axis - [in] rotation_count - [in] fixed_plane - [in] Returns: True if these 4 conditions are satisfied.

  1. rotation_axis is a valid line.
  2. rotation_count >= 2
  3. rotation_count <= ON_Symmetry::MaximumOrder
  4. fixed_plane contains the rotation axis. Remarks: The value ON_Symmetry::ZeroTolerance is used for all "zero tolerances."

◆ MotifCount()

unsigned int ON_Symmetry::MotifCount ( ) const

Returns: Number of types the motif appears in the symmetric object. Remarks: MotifCount() = CyclicOrder()*InversionOrder().

◆ MotifTransformation()

const ON_Xform ON_Symmetry::MotifTransformation ( int  index) const

Description: Get the transformation that maps the starting motif to the specified copy. Parameters: index - [in] 0 based index of the copy (negative values are supported) 0 returns the identity transformation. Remarks: "0 based" means when index is a multiple of MotifCount(), the identity is returned.

◆ OnReflectAndRotateFixedPlane()

bool ON_Symmetry::OnReflectAndRotateFixedPlane ( ON_3dPoint  P,
bool  bUseCleanupTolerance 
) const

◆ operator=()

ON_Symmetry& ON_Symmetry::operator= ( const ON_Symmetry )
default

◆ PointRegion()

ON_Symmetry::Region ON_Symmetry::PointRegion ( ON_3dPoint  point,
bool  bUseCleanupTolerance 
) const

Parameters: point - [in] point to test. bUseCleanupTolerance - [in] The tolerance used to determine if a point is On an axis or plane is bUseCleanupTolerance ? this->CleanupTolerance() : ON_Symmetry::ZeroTolerance. When in doubt, pass false. Returns: The location of the point relative to the primary motif regions.

◆ Read()

bool ON_Symmetry::Read ( class ON_BinaryArchive )

◆ ReflectAndRotatePlane()

const ON_PlaneEquation ON_Symmetry::ReflectAndRotatePlane ( unsigned int  plane_index) const

Description: A reflect and rotate symmetry has three important planes. The reflection plane. This plane is returned by ReflectAndRotatePlane(0). The supplemental plane. This plane is the reflection plane rotated around the rotation axis by angle = -0.5*RotationAngle() and then reversed. This plane is returned by ReflectAndRotatePlane(1). The reflection plane rotated around the rotation axis by pi/2. This plane is returned by ReflectAndRotatePlane(2).

The primary motif region for a reflect and rotate symmetry is region above both the reflection plane and the supplemental plane.

The normals of all planes point into the primary motif region.

Parameters: plane_index - [in] Selects the plane. 0: returns the reflection plane. 1: returns the supplemental plane. 2: returns the half space bounding plane.

Returns: If the symmetry type is ReflectAndRotate and plane_index is valid, the requested plane is returned. Otherwise ON_PlaneEquation::Nan is returned.

◆ ReflectionPlane()

const ON_PlaneEquation ON_Symmetry::ReflectionPlane ( ) const

Returns: If the symmetry is type is Reflect or ReflectAndRotate, then the reflection plane is returned. Otherwise ON_Plane::Nan is returned.

◆ ReflectionTransformation()

const ON_Xform ON_Symmetry::ReflectionTransformation ( ) const

Returns: If the symmetry is type is Reflect or ReflectAndRotate, then the reflection plane is returned. Otherwise ON_Plane::Nan is returned.

◆ RotationAngleDegrees()

double ON_Symmetry::RotationAngleDegrees ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then the rotation angle in degrees is returned. Otherwise ON_DBL_QNAN is returned. Remarks: RotationAngleDegrees() = 360.0/RotationCount()

◆ RotationAngleRadians()

double ON_Symmetry::RotationAngleRadians ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then the rotation angle in radians is returned. Otherwise ON_DBL_QNAN is returned. Remarks: RotationAngleRadians() = (2.0*ON_PI)/RotationCount()

◆ RotationAxis()

const ON_Line ON_Symmetry::RotationAxis ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then the rotation axis is returned. Otherwise ON_Line::Nan is returned.

◆ RotationAxisDirection()

const ON_3dVector ON_Symmetry::RotationAxisDirection ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then the direction of the rotation axis is returned. Otherwise ON_3dVector::Nan is returned. Remarks: This vector may have length != 1

◆ RotationAxisPoint()

const ON_3dPoint ON_Symmetry::RotationAxisPoint ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then a point on the rotation axis is returned. Otherwise ON_3dPoint::Nan is returned.

◆ RotationAxisTangent()

const ON_3dVector ON_Symmetry::RotationAxisTangent ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then a unit vector in the direction of the rotation axis is returned. Otherwise ON_3dVector::Nan is returned.

◆ RotationCount()

unsigned int ON_Symmetry::RotationCount ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then the rotation count is returned. Otherwise 0 is returned.

◆ RotationTransformation()

const ON_Xform ON_Symmetry::RotationTransformation ( ) const

Returns: If the symmetry is type is Rotate or ReflectAndRotate, then the rotation transformation is returned. Otherwise ON_Xform::Nan is returned.

◆ SameSymmetricObjectGeometry() [1/2]

bool ON_Symmetry::SameSymmetricObjectGeometry ( const class ON_SubD subd) const

Returns: True if subd has identical geometry to the subd passed to SetSymmetricObject().

◆ SameSymmetricObjectGeometry() [2/2]

bool ON_Symmetry::SameSymmetricObjectGeometry ( const class ON_SubDimple *  subdimple) const

◆ SameSymmetricObjectTopology() [1/2]

bool ON_Symmetry::SameSymmetricObjectTopology ( const class ON_SubD subd) const

Returns: True if subd has identical topology to the subd passed to SetSymmetricObject().

◆ SameSymmetricObjectTopology() [2/2]

bool ON_Symmetry::SameSymmetricObjectTopology ( const class ON_SubDimple *  subdimple) const

◆ SetCleanupTolerance()

void ON_Symmetry::SetCleanupTolerance ( double  cleanup_tolerance)

Description: Cleanup tolerance is a 3d world unt length used to preprocess input when creating symmetric objects. For example, in a relfect symmetry, cleanup tolerance would be used to move vertices near the reflection plane to be on the reflection plane. This tolerance is context sensitive. In the same model it could vary between two different input objects. The value is saved with the symmetry so calculations driven by modifying an input object can be repeated using the same cleanup tolerance. Parameters: cleanup_tolerance - [in] cleanup_tolerance >= ON_Symmetry::ZeroTolerance. The cleanup tolerance for this specific symmetry. The default is ON_Symmetry::ZeroTolerance.

◆ SetSymmetricObject() [1/2]

bool ON_Symmetry::SetSymmetricObject ( const class ON_SubD subd) const

Description: If the SubD is known to have the symmetry specified by this ON_Symmetry, then SetSymmetricObject() is used to save the subd's geometry and topology hash on this ON_Symmetry. Parameters: subd - [in] This subd must have the symmetry specified by this ON_Symmetry. Returns: True if the symmetric object state was saved on this. False if input is not valid. Remarks: At a later time and after unknown modifications or copying, use SameSymmetricObjectGeometry(subd1) and SameSymmetricObjectTopology(subd1) to determine if subd1 has the same geometry or topology as subd at the time SetSymmetryObject(sub) was called.

◆ SetSymmetricObject() [2/2]

bool ON_Symmetry::SetSymmetricObject ( const class ON_SubDimple *  subdimple) const

Description: If the parent SubD is known to have the symmetry specified by this ON_Symmetry, then SetSymmetricObject() is used to save the subd's geometry and topology hash on this ON_Symmetry. Parameters: subdimple - [in] The parent SubD must have the symmetry specified by this ON_Symmetry. Returns: True if the symmetric object state was saved on this. False if input is not valid. Remarks: The ON_SubDimple version is used internally. Pretend this doesn't exist.

At a later time and after unknown modifications or copying, use SameSymmetricObjectGeometry(subd1) and SameSymmetricObjectTopology(subd1) to determine if subd1 has the same geometry or topology as subd at the time SetSymmetryObject(sub) was called.

◆ SymmetryCoordinates()

ON_Symmetry::Coordinates ON_Symmetry::SymmetryCoordinates ( ) const

Returns: Symmetry type.

◆ SymmetryCoordinatesFromUnsigned()

static ON_Symmetry::Coordinates ON_Symmetry::SymmetryCoordinatesFromUnsigned ( unsigned int  coordinates_as_unsigned)
static

◆ SymmetryCoordinatesToString()

static const ON_wString ON_Symmetry::SymmetryCoordinatesToString ( ON_Symmetry::Coordinates  symmetry_coordinates)
static

◆ SymmetryHash()

const ON_SHA1_Hash ON_Symmetry::SymmetryHash ( ) const

Returns: A SHA1 hash value that uniquely identifies the symmetry settings. Remarks: The symmetric object content serial number and symmetric object hashes are not included in the symmetry hash.

◆ SymmetryId()

const ON_UUID ON_Symmetry::SymmetryId ( ) const

Returns: Symmetry unique id

◆ SymmetryRegionFromUnsigned()

static ON_Symmetry::Region ON_Symmetry::SymmetryRegionFromUnsigned ( unsigned int  region_as_unsigned)
static

◆ SymmetryRegionHasFixedPoints()

static bool ON_Symmetry::SymmetryRegionHasFixedPoints ( ON_Symmetry::Region  symmetry_region)
static

Description: A symmetry region has fixed points if one or more motif transforms of the applicable symmetry type fixes points in the region. Points in these regions typically need special processing when the symmetric object is edited. Returns: True if symmetry_region is one of ON_Symmetry::Region::OnRotationAxis, ON_Symmetry::Region::OnReflectionPlane, ON_Symmetry::Region::OnReflectionHalfPlane, ON_Symmetry::Region::OnSupplementalHalfPlane, or ON_Symmetry::Region::OnRotateAndReflectFixedPlane.

◆ SymmetryType()

ON_Symmetry::Type ON_Symmetry::SymmetryType ( ) const

Returns: Symmetry type.

◆ SymmetryTypeFromUnsigned()

static ON_Symmetry::Type ON_Symmetry::SymmetryTypeFromUnsigned ( unsigned int  symmetry_type_as_unsigned)
static

◆ SymmetryTypeToString()

static const ON_wString ON_Symmetry::SymmetryTypeToString ( ON_Symmetry::Type  symmetry_type)
static

◆ Tolerance()

double ON_Symmetry::Tolerance ( bool  bUseCleanupTolerance) const

Returns: bUseCleanupTolerance ? this->CleanupTolerance() : ON_Symmetry::ZeroTolerance;

◆ ToText()

void ON_Symmetry::ToText ( bool  bIncludeSymmetricObject,
class ON_TextLog text_log 
) const

◆ TransformConditionally()

const ON_Symmetry ON_Symmetry::TransformConditionally ( const ON_Xform xform) const

Description: If SymmetryCoordinates() = ON_Symmetry::Coordinates::Object, then the symmetry definition is transformed.

◆ TransformUnconditionally()

const ON_Symmetry ON_Symmetry::TransformUnconditionally ( const ON_Xform xform) const

Description: The the symmetry definition is transformed.

◆ Write()

bool ON_Symmetry::Write ( class ON_BinaryArchive ) const

Member Data Documentation

◆ ReflectAndRotateId

const ON_UUID ON_Symmetry::ReflectAndRotateId
static

◆ ReflectId

const ON_UUID ON_Symmetry::ReflectId
static

◆ RotateId

const ON_UUID ON_Symmetry::RotateId
static

◆ Unset

const ON_Symmetry ON_Symmetry::Unset
static

◆ ZeroTolerance

const double ON_Symmetry::ZeroTolerance
static

ON_Symmetry::ZeroTolerance is a 3d tolerance use to validate transformations, rotation axis locations, and plane equations. This tolerance is constant across all applications and used to validate symmetric objects. Use the per symmetry ON_Symmetry.CleanupTolerance() to prepare input objects. In a valid symmetric object, the distance between distinct SubD vertex locations must always be greater than ON_Symmetry::ZeroTolerance.