Geometric Modeler

Frequently Asked Questions

Quick Reference

Abstract

Here is a quick-access list of all the FAQs we have received from CAA partners as well as DS internal developers. The questions are sorted by area of interest. In answers, links to the relevant documents or use cases are provided for a more detailed information.

General
Should I work at the geometric or topological level?
How to start using the geometric and topological classes and interfaces?
How to start using the mathematical classes?

Geometry
What do I have to do to in brief to create an attribute?
How can I retrieve an attribute identifier?
What is the difference between a CATMathPoint and a CATPoint?
How to get the 3D point corresponding to a surface parameter?
While projecting a point on curve or surface, the operator does not return the expected value. Can you explain?
Is the first arc number of a curve equal to 1?
How to create Bézier curve?
How is defined the orientation of CATPCircle?
How to create and use curves or surfaces of my own type?
Can you explain the difference between current limits and max limits?
How do I redefine the limits of a curve?
How do I retrieve the current limits of a curve?
How do I retrieve the maximum limits of a  curve?
Given an edge, how can I get the extremities related to this edge on the edge curve?
Given an edge bounded by a face, how can I retrieve the limits of the attached CATPCurve?
What should I use to attach a geometry to an edge, CATEdge::SetCurve or CATEdge::SetGeometryOnFace?
Can an edge-curve represent only one CATCurve, even if the edge bounds two faces?
Can two CATPCurves/CATCurve share the same end points? Can I re-use the CATPointOnEdgeCurve defined on one edge-curve for another edge-curve?
How to copy an object?
How to get the surface parameters of a 3D point?
What is the gap below which two objects cannot be differentiated ?
What method can I use to determine whether the body is having gaps larger than what CATIA can tolerate?

Topology
Can I create several objects from a topological operator in ADVANCED mode?
Does CATopRevol create a skin or volume body?
Do I use the cells and domains to build a body, or topological operators?
How to compute the area of a skin body?
How to get the surface of a skin body?
Can you tell the difference between the GetMatterSide and GetSideOnFace methods? 
When an edge is to be inserted into a loop, should I add it explicitly (CATCell::AddDomain) to the loop?
When an edge is to be inserted into a loop, should I use the CATCell::AddBoundingCell method?
Does loop->Done() check topology as well as geometry?
Do all the edges of a loop need to have geometry before calling loop->Done?
When should I use loop->Done() in an application? Can I call this method at the very last end of my application?
If loop->Done()is not called, are further topological queries affected?

General

Should I work at the geometric or topological level?

The geometry is the support of the topology. The power of the topology is to describe all the connections between the objects. Hence, work at the topological level.

How to start using the geometric and topological classes and interfaces?

The geometric objects are created by CATGeoFactory. CATGeoFactory derives from CATICGMContainer, that manages the geometric objects: scan, removal. To create or load a CATGeoFactory, use the global functions ::CATCreateCGMContainer and ::CATLoadCGMContainer respectively. See: CAAGobNurbs, CAATopSpline.

How to start using the mathematical classes?

The mathematical classes do not need any initialization.
See: CAAMthBase, CAAAmtForeign.

Geometry

What do I have to do to in brief to create an attribute?

Basically, to create an attribute you must use the CreateAttribute method of the CATGeoFactory factory. This method returns a CATICGMAttribute interface whereby you can manipulate the created attribute. But actually, the data which describe your attribute are specified in the form of an attribute implementation which is passed as the argument of the CreateAttribute method. As a developer, the trick is then to write the appropriate attribute implementation.  This has to be done prior to doing anything else. Here is a summary of what you have to do to implement an attribute.

  1. Write the header defining your attribute. The CATCGMDeclareAttribute macro should be used to declare the new attribute class and the attribute class from which the new attribute derives (CATCGMAttribute, CATCGMStreamAttribute or any other attribute class).
  2. Write the related implementation. The CATCGMImplAttribute macro should be used to specify the new attribute class, the attribute class from which the new attribute derives and the application name.
  3. Declare the application name in the dictionary
  4. Check your Imakefile.mk. It must contain the IID declarations.

How can I retrieve an attribute identifier?

There are two ways (See: CAAGobAttributeCreation and CAAGobAttributeRead).

  1. by using the CATCGMAttrId::FindAttrId static method

    const char* iAttr = "CAAGobAttributeManagement";
    const char* iDomainName = "CAAGobAT";
    const CATCGMAttrId* pAttrId = CATCGMAttrId::FindAttrId(iAttr,iDomainName); CAAGobAttributeManagement * piAttr1 =(CAAGobAttributeManagement *) CATCGMAttribute::CreateAttribute(pAttrId);

  2. or by using the UAIDPtr macro

    CAAGobAttributeManagement * piAttr1 =(CAAGobAttributeManagement *) CATCGMAttribute::CreateAttribute(UAIDPtr(CAAGobAttributeManagement));

What is the difference between a CATMathPoint and a CATPoint?

A CATMathPoint instance is transient, it cannot be streamed. A CATPoint instance is persistent when stored on a file. It is created by CATGeoFactory.

How to get the 3D point corresponding to a surface parameter?

This is the evaluation: CATSurface::Evalxxx. See: CAAGobCreation.

While projecting a point on curve or surface, the operator does not return the expected value. Can you explain?

The projection operator returns all the solutions of the operation. The first value returned by the iterator is not necessarily the closest to the initial point. To only retrieve the closest projection point, use CATDistanceMinPtCv or CATDistanceMinPtSur.

Is the first arc number of a curve equal to 1?

Not always. Do never make any assumption on the parameterization of a geometric object. If the object is extrapolated, its first arc number can be negative.

How to create Bézier curve?

A Bézier curve is a particular case of NURBS curve. Hence, there is no dedicated interface for that element. A special constructor CATNurbsCurve allows you to directly create a NURBS that is Bézier. See: CAAGobNurbs.

How to create a CATEdgeCurve?

The derived types can be created as follows:

How is defined the orientation of CATPCircle?

The circle arcs are always oriented counter clockwise, whatever the order of the input parameters. Hence, it is necessary to compute the CATPCurve orientation to be used in CATSkinOperator. See: CAATopOverview

How to create and use curves or surfaces of my own type?

To introduce your own type of curves and surfaces, you must first define the corresponding mathematical definition (by deriving a class from CATMathFunctionX or CATMathFunctionXY). Then, you must create the data class (CATForeignCurveData or CATForeignSurfaceData) to be later use in CATIForeignCurve or CATIForeignSurface. See: CAAAmtForeign, CAAGobForeign

Can you explain the difference between current limits and max limits?

The max limits define the domain inside which the curve or surface can be evaluated. The limits are the domain defined at the curve or surface creation, according to the input parameters. A line created by two points has limits defined by these two points. But it can be evaluated outside the limits: the max limits are infinite. The idea of limits is meaningless in the topology context - but when associating topology with geometry, you need define limits. These limits depend on the cell boundaries which cannot be infinite. When manipulating geometric curves, you can redefine the limits specified at creation.  The main interest of this operation is that you can apply a geometric operator only to this portion of the curve.

How do I redefine the limits of a curve?

You must:

  1. construct the CATCrvParam intended to be used as new limits
  2. construct the new CATCrvLimits
  3. use the CATCurve::SetLimits method

CATCrvParam middleParm(0.5,maxLimits);
const CATCrvLimits newLimits(startlimit ,middleParm);
pCurve->SetLimits(newLimits);

How do I retrieve the current limits of a curve?

To get the current limit of a curve, use the CATCurve::GetLimits, CATCurve::GetStartLimit or  CATCurve::GetEndLimit method. But this only applies to geometry. To retrieve the extremities related to an edge on a curve, you should use CATEdge::GetVerticesParamsOnEdgeCurve.

How do I retrieve the maximum limits of a  curve?

To get the maximum limits of a curve, use the CATCurve::GetMaxLimits method.

Given an edge, how can I get the extremities related to this edge on the edge curve?

The method to be used to retrieve the extremities related to an edge on an edge curve  is CATEdge::GetVerticesParamsOnEdgeCurve.

CATEdge * edge = ...;
CATMathPoint oEdgeCurveStartPt, oEdgeCurveEndPt;
CATCrvParam oEdgeCurveStartParam, oEdgeCurveEndParam;
edge->GetVerticesParamsOnEdgeCurve(&oEdgeCurveStartParam, &oEdgeCurveEndParam);
CATEdgeCurve*edgeCurve=edge->GetCurve();
edgeCurve->Eval(oEdgeCurveStartParam, CATCrvEvalCommand::EvalPoint, &oEdgeCurveStartPt);
edgeCurve->Eval(oEdgeCurveEndParam, CATCrvEvalCommand::EvalPoint, &oEdgeCurveEndPt);

Given an edge bounding a face, how can I retrieve the limits of the attached CATPCurve?

The CATEdge::GetGeometryOnFace allows you to retrieve the limits of the attached PCurve. See How can I retrieve the limits of an edge-curve? for how to get the edgeCurve pointer.

CATEdge * edge = ...;
CATFace * face = ...;
CATEdgeCurve * edgeCurve = ... ;
CATCrvParam oPCurveStartParam, oPCurveEndParam;
CATSide edgeSide = edge->GetMatterSide(face);
CATPCurve * pCurve = edge->GetGeometryOnFace(face, edgeSide, NULL, &oPCurveStartParam, &oPCurveEndParam);
CATMathPoint oPCurveStartPt, oPCurveEndPt;
pCurve->Eval(oPCurveStartParam, CATCrvEvalCommand::EvalPoint, &oPCurveStartPt);
pCurve->Eval(oPCurveEndParam, CATCrvEvalCommand::EvalPoint, &oPCurveEndPt);

What should I use to attach a geometry to an edge, CATEdge::SetCurve or CATEdge::SetGeometryOnFace?

These methods provide you with quite different capabilities. The concept of an edge (CATEdge) is only meaningful in the topology context. The geometric representation of a CATEdge is basically a CATEdgeCurve.  A CATEdgeCurve can represents geometrically several edges. By using the SetCurve method, you associate an already created CATEdgeCurve with a CATEdge. The geometry associated with the CATEdge plays a role with respect to the other faces bounded by this edge.
When you use the SetGeometryOnFace method, you assign a PCurve to an edge with respect to an underlying face.  The operation is different.

If an edge bounds two faces, can the edge curve related to this face represent only one CATPCurve ?

NO - If an edge border several faces: the edge curve represents (at least) as many CATPCurves as there are faces bounded by this edge (see: CAATobTetra). If the edge only borders a face: the edge curve represents (at least) one CATPCurve. If the edge belongs to a CATWire: the edge curve represents a CATCurve of any type.

Can I re-use the CATPointOnEdgeCurve defined on one edge-curve for another edge-curve?

NO-When you create a CATPointOnEdgeCurve point, you actually create this point with respect to a CATPCurve limit as well as the edge curve on which the point is intended to be created. This point cannot be reused for another edge because it is labelled with these parameters. The usual methodology behind a CATPointOnEdgeCurve is to use them to create macropoints intended to be used later on to set the geometry of edge vertices. See: CAATobTetra.

How to copy an object?

CATCloneManager manages all the copy mechanism. In particular, it manages the links between objects during the copy. See: CAAGobCreation.

How to get the surface parameters of a 3D point?

If the point is known to be on the surface, and if the surface is canonical, you can directly use CATSurface::GetParam. In the other cases, use the CATProjectionPtSur operator. This operator can also be used in case of canonical surface. Do never make any assumption on the parameterization of the geometric objects. See: CAATobTetra, CAATopOverview, CAATopJournal (for GetParam)

What is the gap below which two objects cannot be differentiated ?

CGM manages a parameter called the resolution which represents the minimum length of an object. Confusion zones are managed through this parameter -  you won't be about to make the difference between two objects when the gap in between is smaller than the resolution. The resolution in Version 5 is 10 -3 model unit(mm). You cannot change this resolution.

What method can I use to determine whether the body is having gaps larger than what CATIA can tolerate?

You can use CATEdgeCurve->GetMaxGap().

Topology

Can I create several objects from a topological operator in ADVANCED mode?

Definitely NO - One operator - One run. Multi run is not allowed for an operator. Within an application, you are required to delete the operator prior to creating a new one and run it in order to create a new object.

Does CATopRevol create a skin or volume body?

If the input body is a wire, it creates a skin body. If the input body is a skin body, it creates a volume body

Do I use the cells and domains to build a body, or topological operators?

The topological operators allows you to get rid of the tricky direct topological construction from the cells. So use them to create the bodies. The cell and domain interfaces can be used to scan the topological structure, or to retrieve the underlying geometry. See: CAATobTetra, CAATopOverview

How to compute the area of a skin body?

Use the CATDynMassProperties3D operator, and get the area with GetWetArea.

How to get the surface of a skin body?

A skin body is a body containing a shell domain. This shell is a connection of several faces. Each face has a geometry, that can be accessed by CATFace::GetSurface. More generally, the geometry of a cell is retrieved with CATCell::GetGeometry. See: CAATopJournal (to get the surface), CAATopJournal (to get the shell domain), CAATobTetra (to get the geometry of a cell).

Can you tell the difference between the GetMatterSide and GetSideOnFace methods? 

GetSideOnFace is a CATEdge method. As such it can only be applied to a CATEdge object to retrieve the matter side on a given face. The argument must be a CATFace. GetMatterSide is a CATCell method which can be applied to any type of cell (vertex, edge or face) to retrieve the matter side on a given cell. The type of the cell specified as the argument must be higher than this in the topology hierarchy. In other words, you can apply GetMatterSide:

Note: Given this an edge, specifying a CATVolume as the argument of GetMatterSide results in a throw (to be avoided).
If you want to retrieve the matter side of an edge on a face, you can use either method.

When an edge is to be inserted into a loop, should I add it explicitly to the loop?

You can always use the AddCell method of the CATDomain interface - But that way, you just specify your topology. If you need specify the geometry as well you must call the SetGeometryOnFace method. Actually you can use either method:

myFace->AddBoundingCell(theEdge, theSide, theLoop, theUnderlyingGeometry);

or

theLoop->AddCell(theEdge, theSide);
theEdge->SetGeometryOnFace(myFace,theSide,theUnderlyingGeometry,NULL,NULL);

You don't need specify the start and end vertices in SetGeometryOnFace if the edge geometry is already defined (NULL value can be passed for the arguments 4 and 5 of SetGeometryOnFace). Otherwise, you must specify the Poec related to the edge in SetGeometryOnFace.

When an edge is to be inserted into a loop, should I use the CATCell::AddBoundingCell method

YES - You set the topology as well as the geometry in a single operation. See: CAATobTetra.

Does loop->Done() check topology as well as geometry?

The Done() method checks that all the cells of a loop have an associated geometry. If the geometry is not fully defined, the method results in a Throw.

In CAATobTetra, if you replace:

piFaceyz->AddBoundingCell(piEdge30,CATSideRight,piLoopyz,piPLineyz20);
piFaceyz->AddBoundingCell(piEdge23,CATSideRight,piLoopyz,piPLineyz12);
piFaceyz->AddBoundingCell(piEdge20,CATSideLeft,piLoopyz,piPLineyz01);
piLoopyz->Done();

with

piFaceyz->AddBoundingCell(piEdge30,CATSideRight,piLoopyz,NULL);
piFaceyz->AddBoundingCell(piEdge23,CATSideRight,piLoopyz,NULL);
piFaceyz->AddBoundingCell(piEdge20,CATSideLeft,piLoopyz,NULL);
piLoopyz->Done();

the edge to be inserted in the piLoopyz have no associated geometry, piLoopyz->Done() results in a throw.

Do all the edges of a loop need to have geometry before calling loop->Done?

See question above. You get a Throw if not all the edges of a loop have an associated geometry.

When should I use loop->Done() in an application? Can I call this method at the very last end of my application?

loop->Done() should be called when the construction of a body is finished. Not calling Done() may lead to unpredictable results when further operations are carried out on the body.

If loop->Done() is not called, are further topological queries affected?

NO. You can make any topological query on the body.

 


History

Version: 1 [Jul 2000] Document created
[Top]

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