DiscussionsIssue archiveOther usage issues

Archived discussion

Offset 2D Polygon

Other usage issuesFri, 03/25/2005 - 20:162 replies

Browse this forum
QuestionAuthor

Hello,
How can I offset an open Polygon?
Andrea

Discussion

2 archived replies

Posts are displayed in their archived order.

01Commenter-1

Hi Andrea,

Won't BRepOffsetAPI_MakeOffset work ?

Commenter-1

02Commenter-2

Provided offset function (for wires and geomcurves) never worked reliably for me; for polygons, I just went through the nodes and would offset every one in the angle determined by adjacent edges.

[UNFORTUNATELY, one can not paste preformatted code in this FORUM... I wonder if SOMEONE can do SOMETHING about it - please!]

The code (ignore line numbers):
10 Handle(Poly_Polygon3D)
11 Heal::OffsetPoly(Handle(Poly_Polygon3D) P, Standard_Real offset){
12 const TColgp_Array1OfPnt& Pp=P->Nodes();
13 TColgp_Array1OfPnt offPp(1,Pp.Length());
14 int imax=Pp.Length()-1, iprev, inext;
15 for(int i=1; i<=Pp.Length(); i++){
16 iprev=i>1?i-1:imax;
17 inext=i<=imax?i+1:2;
18 //DBG_HEAL<<"["<