Equipment & Systems Engineering

Electrical Harness Flattening

Arranging junctions

How to arrange junctions
Use Case

Abstract

This article discusses the ElecFlatteningItf use case. This use case explains how to arrange junctions


What You Will Learn With This Use Case

This use case is intended to help you make your first steps in programming with CATIA EHF Interfaces. Its main intent is to allow you to arrange junctions.

[Top]

The CAAEhfUIPArrangeJunction Use Case

CAAEhfUIPArrangeJunction.m is a use case of the CAAElecFlatteningItf.edu framework that illustrates the CATIA EHF Interfaces framework capabilities.

[Top]

What Does CAAEhfUIPArrangeJunction Do?

The goal of CAAEhfUIPArrangeJunction use case is to show how to arrange junctions.

                                                                                                                             

                                               [Top]

How to Launch CAAEhfUIPArrangeJunction ?

To launch CAAEhfUIPArrangeJunction , you will need to set up the build time environment, then compile CAAEhfUIPArrangeJunction along with its prerequisites, set up the run time environment, and then execute the sample.

To launch the use case, execute the following command:

mkrun
Open Extr_Flat.CATProduct

[Top]

 Where to Find the CAAEhfUIPArrangeJunction Code

The CAAEhfUIPArrangeJunction sample is made of a single class named CAAEhfUIPArrangeJunction located in the CAAEhfUIPArrangeJunction.m module of the CAAElecFlatteningItf.edu framework:

Windows InstallRootDirectory\CAAElecFlatteningItf.edu\CAAEhfUIPArrangeJunction.m\
Unix InstallRootDirectory/CAAElecFlatteningItf.edu/CAAEhfUIPArrangeJunction.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

 

This sample deals with the following classes:

 

CATMathVector Class representing a mathematical vector in 3D
CATMathLine Class representing a mathematical line in 3D
CATMathTransformation Class representing a mathematical transformation in 3D
CATMathPoint Class representing a mathematical point in 3D

[Top]

 

Step-by-Step

------------------------------------------

We will now comment all the steps. There are 10 logical steps :

# Step
1 Check the input data
2 Get the normal vector and the origin of the flattening plane
3 Get the rotation axis
4 The first vector is the reference vector of the fixed branch
5 Empty the List Of Directions
6 Fill with pRefVector
7 For all other vectors, a rotation of 15 degrees is computed - Get the transformation
8 Retrieve the new vector rotated
9 Append the new vector rotated
10 Delete the pointer on the transformation

[Top]

Check the input data.

 

...
if (( 2 > NbVectors ) || ( 2 > NbExtremities ))
{ 
retCode = E_FAIL; 
goto EscapeWay;
}
...

[Top]

Get the normal vector and the origin of the flattening plane.

...
iFlatteningPlane.GetNormal(Normal);
iFlatteningPlane.GetOrigin(Origin);
...

[Top]

Get the rotation axis.

....
pRotationAxis = new CATMathLine(Origin,Normal);
if (NULL == pRotationAxis)
{
retCode = E_FAIL; 
goto EscapeWay;
}
....

[Top]

 

 

The first vector is the reference vector of the fixed branch.

....
RefVector = *(ioListOfDirections[1]);
....

 

 

Empty the List Of Directions.

 

....
for (Index = 1; Index <= NbVectors; Index++)
{
delete ioListOfDirections[Index];
ioListOfDirections[Index] = NULL;
}

ioListOfDirections.RemoveAll();
....

 

 

Fill with pRefVector

 

....
pVector = new CATMathVector(RefVector);
if (NULL == pVector)
{
retCode = E_FAIL; 
goto EscapeWay;
}
ioListOfDirections.Append(pVector) ;
pVector = NULL;
....

[Top]

For all other vectors, a rotation of 15 degrees is computed - Get the transformation .

 ...
Angle = 15 * (Index-1);


//Convert into Radians, because, CATMathTransfo need Radian
Angle = Angle * CATDegreeToRadian ;
pRotation = new CATMathTransformation(Angle, *pRotationAxis) ;
if (NULL == pRotation)
{
retCode = E_FAIL; 
goto EscapeWay;
}
 ...

[Top]

 

Retrieve the new vector rotated

 

....
pVector = new CATMathVector ((*pRotation) * RefVector);
if (NULL == pVector)
{
retCode = E_FAIL; 
goto EscapeWay;
}
pVector->Normalize() ;
....

[Top]

 

Append the new vector rotated.

 

....
ioListOfDirections.Append(pVector) ;
....

[Top]

 

Delete the pointer on the transformation

 

....

delete pRotation;
pRotation = NULL;
....

[Top]


In Short

This use case has demonstrated the way to arrange junctions. 

[Top]


History

Version: 1 [January 2007] Document Created
[Top]

Copyright © 2007, Dassault Systèmes. All rights reserved.