Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
Open CASCADEShowroomGet it!Developer CornerSupport and ProductsAbout us
Technical overview
Areas of use
Advantages
FAQ
Screenshots
Shape factory
Shape gallery
Demonstrations
What's new
System requirements
Download Center
Public license
Documentation
Getting started
Forums
Open Source community
Training and e-learning
A-la Carte Support
Value-added software
Complementary Components
Customer Corner
Company Profile
Marketing Materials
Contact Us
News
Home / Developer Corner / Forums / Usage issues / Parallel projection of spline curves onto plane

Parallel projection of spline curves onto plane

Parallel projection of spline curves onto plane
Fabian Hachenberg 2011/01/24 16:52
I'm trying to project a wire onto a plane. What I need are 2d curves. My approach so far is the following:
-retrieve the 3d-curve of every edge in the wire
-project the curve onto the plane using ProjLib_ProjectOnPlane
-create a 2d curve adaptor using ProjLib_ProjectedCurve.

The problem is that ProjLib_ProjectedCurve obviously cannot project splines. In the code, there are only empty switch cases:

[code]
static void Project(ProjLib_Projector& P, Handle(Adaptor3d_HCurve)& C)
{
GeomAbs_CurveType CType = C->GetType();
switch (CType) {
case GeomAbs_Line:
P.Project(C->Line());
break;
case GeomAbs_Circle:
P.Project(C->Circle());
break;
case GeomAbs_Ellipse:
P.Project(C->Ellipse());
break;
case GeomAbs_Hyperbola:
P.Project(C->Hyperbola());
break;
case GeomAbs_Parabola:
P.Project(C->Parabola());
break;
case GeomAbs_BSplineCurve:
case GeomAbs_BezierCurve:
case GeomAbs_OtherCurve: // try the approximation
break;
default:
Standard_NoSuchObject::Raise(" ");
}
}
[/code]

Do I have to implement the call to ProjLib_ComApprox myself now? I cannot believe that I am the first person requiring to project splines onto a plane, so there must be a usable way implemented already...
A 2011/01/25 15:09
did you try to use BRepProj_Projection? In this case you can project wire or edge to face.
Fabian Hachenberg 2011/01/26 13:26
Hi,
i found out now, that ProjLib_ProjectedCurve is working for splines as well (the implementation is a bit confusing, which is why i thought it wasn't implemented)!

BrepProj_Projection doesn't do parallel projection but central projection onto cones and cylinders. See here http://mathworld.wolfram.com/CylindricalProjection.html
Anton 2011/01/26 18:06
> BrepProj_Projection doesn't do parallel projection

And that is one of the strange things in BrepProj_Projection, because in my case it does paralel projection.
Andrey BETENEV 2011/01/27 07:50
This is correct: in BRepProj_Projection class, "cylindrical" projection means parallel one (the infinite cylindrical surface is extruded from the curve to be projected in specified direction, and gets intersected with the target shape). Similarly, "conical" projection means that conical surface with given apex is constructed. Thus the terms have different meaning than that is described at the referred Wolfram page, which is about map projections.

The documentation of the BRepProj_Projection class shall definitely be improved to clarify this.
Ankit 2012/11/22 13:03
Hi Andrey BETENEV,
I want to do parallel projection of a polygon wire on a shape(a sewed shape from more than one faces) and get a projected shape/face out of it.

I used BRepProj_Projection but it did not work for me.

Can you suggest something??
Ankit 2012/11/22 13:08
Hi Andrey BETENEV,
I want to do parallel projection of a polygon wire on a shape(a sewed shape from more than one faces) and get a projected shape/face out of it.

I used BRepProj_Projection but it did not work for me.

Can you suggest something??
PG 2012/11/22 14:50
parallel projection should work , this is a sketchy code from test harness
implmentation to do a parallel/cylindrical projection.
--------------------------------

TopoDS_Shape InpLine ;
TopoDS_Shape InpShape ;
Standard_Real DX=atof(a[4]),DY=atof(a[5]),DZ=atof(a[6]);
gp_Dir TD(DX,DY,DZ);
BRepProj_Projection Prj(InpLine,InpShape,TD);
Standard_Integer i = 1;

if (Prj.IsDone()) {
while (Prj.More()) {
Prj.Current());
i++;
Prj.Next();
}
}

Go thru the documentation of the class.

good luck
- PG
 
 
Latest news
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!
  • Open CASCADE Technology 6.7.0 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map