Cog3DBox SetOriginVertexXVectorYVectorZ Method Cognex VisionPro 9.7
Set the box's origin vertex, extent X vector, extent Y vector, and Z height.

Namespace: Cognex.VisionPro3D
Assembly: Cognex.VisionPro3D.Core (in Cognex.VisionPro3D.Core.dll) Version: 73.0.0.0
Syntax

public void SetOriginVertexXVectorYVectorZ(
	Cog3DVect3 originVertex,
	Cog3DVect3 xVector,
	Cog3DVect3 yVector,
	double z
)

Parameters

originVertex
Type: Cognex.VisionPro3D Cog3DVect3
The origin vertex of the box.
xVector
Type: Cognex.VisionPro3D Cog3DVect3
The extent X vector of the box. Note that this vector corresponds to the Size.X extent in ScaledUnitBox space. See the Remarks section.
yVector
Type: Cognex.VisionPro3D Cog3DVect3
The extent Y vector of the box. Note that this vector corresponds to the Size.Y extent in ScaledUnitBox space. See the Remarks section.
z
Type: System Double
The Z height of the box. Note that this vector corresponds to the Size.Z extent in ScaledUnitBox space. See the Remarks section.
Events

Event TypeReason
ICogChangedEvent Changed

Fires when some properties change.

The following state flags may be affected:

  • SfGetShapeFromScaledUnitBox
  • SfCenter
  • SfSize
  • SfGetSurfaces
  • SfGetLineSegments
  • SfGetVertices
  • SfGetOriginVertexXVectorYVectorZ
  • SfComputeBoundingBox
  • SfComputePerimeter
  • SfComputeArea
  • SfComputeVolume
  • SfIsDegenerateCurve
  • SfIsDegenerateSurface
  • SfIsDegenerateVolume
Exceptions

ExceptionCondition
ArgumentException If xVector or yVector is (0,0,0), or xVector and yVector are parallel.
Remarks

Notes:
  • If yVector is not perpendicular to xVector internally a new yVector is generated as follows and used instead:
    • Create a plane with normal direction of xVector;
    • Project yVector to this plane, and get the projected vector yVectorInternal;
    • Scale yVectorInternal to have the same length as yVector.
    Otherwise, yVectorInternal = yVector.
  • Size.X will be xVector.Length, and Size.Y will be yVector.Length, and Size.Z will be z.
  • The implicit extent Z vector's direction is decided by the cross product of xVector and yVectorInternal.
  • Assume that the extent Z vector is named as zVectorInternal, then the center of the box will be: originVertex + (xVector + yVectorInternal + zVectorInternal * z/zVectorInternal.Length)/2
See Also