Problems with BRepProj_Projection

Hi

I´ve created a face with BRepOffsetAPI_ThurSections with about 20 section. On the resulting face, i want to project a wire. Sometimes the resulkt of the projection is very strange. The length of the projected wire is much longer than the original one.

I guess there muts bie something wrong with the face.

Has anyone an idea or a hint?

regards
Joachim

Forum supervisor's picture

Dear Joachim,
Could you provide additional information (shapes, script, scenario...) necessary for the problem reproducing?
Regards

Joachim Greiner's picture

I want to create a surface through about 20 wires. (See the attached image).
These wires are computed of points in the following way:
I have an array with points and calculate a Geom_Curve

GeomAPI_Interpolate interpol1(point_harray,Standard_False,0.000001);
interpol1.Perform();

Handle(Geom_Curve) section1;
if (interpol1.IsDone() == Standard_True)
section1 = interpol1.Curve();

TopoDS_Edge section_edge = BRepBuilderAPI_MakeEdge(section1);
TopoDS_Wire section_wire = BRepBuilderAPI_MakeWire(section_edge);

I add all the wires to my BrepOffsetAPI_ThruSections Object
BRepOffsetAPI_ThruSections myThruSections;
for(....)
{
myThruSection.Add(wire)
}
TopoDS_Shape myShape = myThurSections.Shape();

If I project a wire on this surface for example (with BRepProj_Projections), sometimes there are wrong results and I can´t explain that.

regards
Joachim

Attachments: 
Forum supervisor's picture

Dera Joachim,
Save, please the specified surface (myShape) and the wire in an external file, for example in .brep format (see BRepTools::Write() method) and attach to the post.
We will try to check the problem.
Regards

Joachim Greiner's picture

Hi

attached you will find the Shape an the wire taht I wnat to project on the surface

Regards
Joachim

Attachments: 
Forum supervisor's picture

Dear Joachim,
Very probably that the obtained result sufficiently depends on direction of the projection and curvature of the surface.
I suggest you to use API of normal projection (BRepOffsetAPI_NormalProjection).
I hope it will help you.
At least in Draw the specified effect is not reproduced:
pload ALL
restore myShape.brep s
restore wire.brep w
nproject r w s
whatis r
explo r
mkcurve cr r_1
length cr
## The length cr is 276.95483736784843
whatis w
explo w
mkcurve wr w_1
length wr
##The length wr is 276.94516948518498

So, wr & cr are ~ equal.

Besides take into account, please that your initial face is not valid:
Draw[130]> checkshape s
On Shape faulty_1 :
BRepCheck_No3DCurve
On Shape faulty_2 :
BRepCheck_No3DCurve
On Shape faulty_3 :
BRepCheck_No3DCurve
On Shape faulty_4 :
BRepCheck_No3DCurve
On Shape faulty_5 :
BRepCheck_UnorientableShape
Shape faulty_1 on shape faulty_5 :
BRepCheck_NoCurveOnSurface
Shape faulty_2 on shape faulty_5 :
BRepCheck_NoCurveOnSurface
Shape faulty_3 on shape faulty_5 :
BRepCheck_NoCurveOnSurface
Shape faulty_4 on shape faulty_5 :
BRepCheck_NoCurveOnSurface

Faulty shapes in variables faulty_1 to faulty_5

Use to fix it.
Regards

Joachim Greiner's picture

Thank you very much for your help!

I found out, that the wires, the surface ist made of should have the same length. If I make sure tehy all have the same length. The Surface ist valid an the problem does not occur.

Ankit's picture

Dear Forum supervisor,
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??

Forum supervisor's picture

Dear Ankit,
You are duplicating the same post many times:
- http://www.opencascade.org/org/forum/thread_19788/
- http://www.opencascade.org/org/forum/thread_24058/
- http://www.opencascade.org/org/forum/thread_22309/
It is not welcomed by Forum rules - http://www.opencascade.org/org/forum/thread_1 .
Please avoid it in the future.

If you need our professional support you may contact us via the Contact Form http://www.opencascade.org/about/contacts/.
We will try to find a solution/workaround acceptable for you.
Training and e-learning courses are also at your disposal - http://www.opencascade.org/support/training/.
Regards

Ankit's picture

I will definitely do the same. Actually i needed that solution ASAP so was trying to put
more posts. I was not aware of the contact list. Thanks for providing the info.

Regards,
Ankit