Jump to content
Developer Wiki and Function Reference Links ×

Convert NURBS into a closed Poly


CodeGier

Recommended Posts

Hello,

I am working on the 2D look of a 3D path PIO using this function to convert a Nurbs into a polyline:

FUNCTION Nurbs2Poly(aPathHD : HANDLE; aPos : REAL) : HANDLE;

VAR

h : Handle;

BEGIN

h := CreateOffsetNurbsObjectHandle(aPathHD, aPos);

Nurbs2Poly := MakePolyline(h);

DelObject(h);

END;

It works, but in VW2012 the polyline is closed. I do need an open one! Same behaviour with MakePoly the polygon is closed too.

I tried to use OpenPoly with my code, but it didn't work either.

Any idea how I get an open polyline (or polygon) out of my code?

Thanks in advance.

Josef

Link to comment

There are 2 ways you can have a closed poly:

1. The first and last vertex are at the same coordinates.

2. The last segment has its visibility turned on.

Depending on which case you have, the options for each are:

1. Just delete the last vertex with:

DelVertex(objectHd:HANDLE; vertexNum:INTEGER);

and then do #2 also if still closed.

2. Turn off the last segment with:

SetPolyClosed(polyHandle:HANDLE; isClosed:BOOLEAN); or

SetVertexVisibility(h:HANDLE; vertnum:INTEGER; vis:BOOLEAN);

you may also need to set the fill to 0 (unfilled) for a line string look

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...