Jump to content
Developer Wiki and Function Reference Links ×

SetPolylineVertex not working


Recommended Posts

Try either of the SetPolylineVertex lines below independently and they work but allowing both to run produces an object with the bottom right curve at 94.65° but not the 140° as required. Any ideas as to how I can get this working?

procedure test;

var

h1 : handle;

x, y, vertexType, vertexRadius : real;

begin

Poly3D (5, -5, 0, 300, -300, 0, 300, -757, 0, 5, -462, 0);

h1 := ConvertToPolyline (LNewObj);

GetPolylineVertex (h1, 2, x, y, vertexType, vertexRadius);

SetPolylineVertex (h1, 2, 300, -300, 3, 140, true);

{

SetPolylineVertex (h1, 3, 300, -757, 3, 140, true);

}

end;

run (test);

Link to comment

Mr. Do,

   Your problem is not "really" a bug, but rather a limitation that is constraining one of your radii. When you create a Polyline with two consecutive "curve" points, imagine there is an invisible point halfway between them. The first arc you define doesn't see that "voodoo" point because it (pt. 2) is surrounded by corner points (pts. 1 & 3). Once point 2 is converted to an Arc Vertex, when you then try to change point 3 to an Arc Vertex you will encounter the "invisible" point. In your example, it exists at (300, -528.5), which is halfway between points 2 & 3 of the starting 2D polygon.

   The way to overcome this obstacle is to place a Corner Point between your two fillet points such that it allows the full radius of each to be realized. The algebra is more than I care to address at this time, but if you run your script with the following mods I made, it will work.

PROCEDURE test;
VAR
h1 : handle;
x, y, vertexType, vertexRadius : real;
BEGIN
Poly3D (5, -5, 0,   300, -300, 0,   300, -757, 0,   5, -462, 0);
h1 := ConvertToPolyline (LNewObj);
InsertVertex(h1, 300, -390, 3, 0, 0);   { this line helps }
SetPolylineVertex (h1, 2, 300, -300, 3, 140, true);
SetPolylineVertex (h1, 4, 300, -757, 3, 140, true);   { pt 3 becomes pt 4 }
END;
Run (test);

   Welcome to the world of polyline editing.

Raymond

Link to comment

Excellent Raymond,

Yes I can understand the problem of finding that Insert point when the angle changes so I'll work on that next.

I did try changing the last vertex but I didn't think of the relationship between them which would be broken by adding the vertex.

Regards

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...