Parameter P in BRep_Builder.UpdateVertex(V,P,E,tol)?

Can somebody tell me what the parameter P is in
BRep_Builder.UpdateVertex(V, P, E, tol)
where
V is TopoDS_Vertex
P is Standard_Real
E is TopoDS_Edge
tol is Standard_Real

It's used in the TopologyBuilding sample in the TopologyBuildingDoc::OnBuilder() method:
//Edge X00
L = new Geom_Line(gp_Pnt(0,0,0),gp_Dir(1,0,0));
B.MakeEdge(EX00,L,precision);
V000.Orientation(TopAbs_FORWARD);
V100.Orientation(TopAbs_REVERSED);
B.Add(EX00,V000);
B.Add(EX00,V100);
//Parameters
B.UpdateVertex(V000,0,EX00,precision);
B.UpdateVertex(V100,200,EX00,precision);

If I change the parameter from 200 to, say, 100, the corresponding edge is half as long. I'm trying to understand why that is.

c-riddell's picture

Reposting to see if I can fix some formatting. Please excuse the duplicate and if the formatting isn't any better, I would love some tips on formatting postings.

Can somebody tell me what the parameter P is in Rep_Builder.UpdateVertex(V, P, E, tol)
where:

  V is TopoDS_Vertex
  P is Standard_Real
  E is TopoDS_Edge
  tol is Standard_Real

It's used in the TopologyBuilding sample in the TopologyBuildingDoc::OnBuilder() method:

  //Edge X00
  L = new Geom_Line(gp_Pnt(0,0,0),gp_Dir(1,0,0));
  B.MakeEdge(EX00,L,precision);
  V000.Orientation(TopAbs_FORWARD);
  V100.Orientation(TopAbs_REVERSED);
  B.Add(EX00,V000);
  B.Add(EX00,V100);
  //Parameters
  B.UpdateVertex(V000,0,EX00,precision);
  B.UpdateVertex(V100,200,EX00,precision);

If I change the parameter from 200 to, say, 100, the corresponding edge is half as long. I'm trying to understand why that is.

Roman Lygin's picture

Cory,

BRep_Builder::UpdateVertex() updates all edge's curve representations (3D or parametric curves in 2D face space, aka pcurves) to end at parameter P. The choice whether it is a starting parameter or ending parameter is made depending on which vertex V it's requested - starting or ending.
This is however a not most frequently used API. If you intend to create a straight line segment edge you should rather use BRepBuilderAPI_MakeEdge.

Hope this helps.

Roman
---
opencascade.blogspot.com - blog on Open CASCADE
Join the Open CASCADE Group at LinkedIn

Francois Lauzon's picture

Hello Cory,
like Roman said, it's used to specify the parametric coordinate of the vertex on the edge. Have you look at cdl files for documentation, because that's a place you could have found this information (BRep_Builder.cdl). If you start digging into OCC, you will find those file really helpful.

Good Luck,
Francois.

PS: You might want to have a look at http://www.opencascade.org/org/community/projects/?project_id=53 or http://www.opencascade.org/org/community/projects/?project_id=185

c-riddell's picture

As far as I can tell, in this case the CDL file has the similar information as the doxygen docs for BRep_Builder:
Sets the parameter for the vertex on the edge curves
I'll keep in mind though that the CDL files are useful as documentation.

Roman's explanation was actually a lot more helpful than this. I especially appreciated his comments about the relative obscurity of the UpdateVertex() API and his recommendation to use BRepBuilderAPI_MakeEdge.

Francois Lauzon's picture

Hello Cory,
BRep_Builder is used to build topology from the ground up when you need to have more control over what you're building (in terms of parametric value of vertex on curve, vertex on face,...), it's a low level api. We used it a lot to build a topology from Catia V5 to Open Cascade and we need to make sure it's the same (same underlying face, same parametrisation, ...)

So glad to hear you need something higher level. Also, it seems that the doxygen documentation is now the same as the cdl documentation.

Francois.