WCS Object

Defines a working coordinate system which will be the base for the next new solids.

General Methods

ActivateWCS ( string <"local","global">)

This method allows to switch from global to local coordinates and reverse.

 

Store ( name WCSName )

Stores the active WCS with the given name.

 

Restore ( name WCSName )

Restores the WCS with the given name.

 

Delete ( name WCSName )

Deletes the WCS with the given name.

 

Rename ( name oldName, name newName  )

Changes the name of an already named WCS.

Defining a WCS

SetNormal ( double x , double y, double z )

Defines the Normal axis (w) of the Working Coordinate System (WCS) in global coordinates (x,y,z).

 

SetOrigin ( double x , double y, double z )

Defines the origin of the Working Coordinate System (WCS).

 

SetUVector ( double x , double y, double z )

Define u-vector of the WCS coordinate system.

 

AlignWCSWithSelected( enum{ "Point", "3Points", "Edge", "EdgeCenter", "RotationEdge", "Face" } mode)

Depending on mode does the following:

RotateWCS ( enum{ "u", "v", "w" } axis,   double angle )

Rotates the axis of the Working Coordinate System clockwise of about the angle degree.

 

MoveWCS ( enum{ "global", "local" } axis, double du, double dv, double dw )

Shifts the Working Coordinate System (WCS). With the key option ”local” you can move the WCS about (du, dv, dw) in local coordinates. To move the WCS in global coordinates use the key setting ”global”.

 

AlignWCSWithGlobalCoordinates

The position of the WCS will be changed to the position of the Global Coordinate System. In other words, a reset of the WCS into its origin position.

WCS Appearance

SetWorkplaneSize ( double wpSize )

The workplane is a square grid. This setting can be used to enlarge its size. The value wpSize defines the shortest distance between the origin and one of the sizes of the workplane. A value of wpSize smaller than the outer dimensions of a already defined structure will have no effect.

 

SetWorkplaneRaster ( double rasterSize )

Sets the raster width of the working plane.

 

SetWorkplaneSnap ( bool flag )

Switches the snap option on or off. This causes that only input values that match the snap width can be input by mouse because the value will always be snapped to the snap raster.

 

SetWorkplaneAutoadjust ( bool flag )

Switches the raster auto adjust option on or off. This causes an automatic change of  the raster size if the working plane is too large or too small.

 

SetWorkplaneSnapAutoadjust ( bool flag )

Switches the snap width auto adjust option on or off. This causes an automatic change of  the snap width if the working plane is too large or too small.

 

SetWorkplaneSnapRaster ( double snapRasterSize)

Sets the Snap Raster width. This setting has only an effect on the interactive construction via mouse. The Snap Raster is a grid of snap points. If a point is picked by mouse near to one of these snap points, the selected point snaps to the grid point. The Snap switch must be turned on, otherwise this setting will have no effect.

Queries

IsWCSActive (  ) string <"local","global">

This method queries whether global or local coordinates are active

 

DoesExist ( name WCSName ) bool

Checks if the WCS with the given name does exist.

 

DoesExist ( name WCSName ) bool

Checks if the WCS with the given name does exist.

 

GetOrigin ( name WCSName, double_ref x, double_ref y, double_ref z ) bool

Stores the origin of the specified working coordinate system in x, y and z, returns True if successful.

 

GetNormal ( name WCSName, double_ref x, double_ref y, double_ref z ) bool

Stores the normal of the specified working coordinate system in x, y and z, returns True if successful.

 

GetUVector ( name WCSName, double_ref x, double_ref y, double_ref z ) bool

Stores the u-vector of the specified working coordinate system in x, y and z, returns True if successful.

 

GetAffineMatrixUVW2XYZ ( name WCSName, double_ref ux, double_ref uy, double_ref uz,

double_ref vx, double_ref vy, double_ref vz,

double_ref wx, double_ref wy, double_ref wz ) bool

Returns True if succeeded and fills the 9 parameters with the affine transformation matrix from the specified working coordinate system to the global coordinate system.

 

GetAffineMatrixXYZ2UVW ( name WCSName, double_ref ux, double_ref vx, double_ref wx,

double_ref uy, double_ref vy, double_ref wy,

double_ref uz, double_ref vz, double_ref wz )  bool

Returns True if succeeded and fills the 9 parameters with the affine transformation matrix from the global coordinate system to the specified working coordinate system.

 

GetWCSPointFromGlobal ( name WCSName, double_ref u, double_ref v, double_ref w,

double x , double y, double z  ) bool

Fills u, v and w with the coordinates in the WCS of a point specified by the global coordinates, returns True if successful.

 

GetGlobalPointFromWCS ( name WCSName, double_ref x, double_ref y, double_ref z ,

double u , double v, double w ) bool

Fills x, y and z with the global coordinates of a point specified by the local coordinates of the working coordinate system, returns True if successful.

Default Settings:

SetWorkplaneSnap (True)

ActivateWCS ("global")

SetWorkplaneAutoadjust (True)

SetWorkplaneSnapRaster (0.1)

Example:

WCS.MoveWCS ("local", 0.0, "b+5", 10)