Jump to content
Developer Wiki and Function Reference Links ×

3D extrude along path rotates randomly


Recommended Posts

Hi,

I've been struggling with this issue for a while. I have a 3D path based object that extrudes a circle / rectangle.

If each vertex has the same Z-value the extrude is fine.

From the moment I have +2 vertexes, where one of them has a different Z-value the extrude rotates 90 degrees.

If I have only 2 vertexes with elevation the extrude is some random degree as shown in the image.

EDIT: I seem to have it too when there is no elevation between the vertexes, but rarely.

This is the code used for the extrude:

IF pType='ROND' THEN Oval(-D1/2,D1/2,D1/2,-D1/2) ELSE Rect(-D1/2,D2/2,D1/2,-D2/2);
Hd3D:=F_ExtrudeAlongPath(path3DHd,D1,D2,LNewObj,pType,ObjClass3D);

F_ExtrudeAlongPath function

FUNCTION F_ExtrudeAlongPath(F_PathHd	:HANDLE; F_Width,F_Height	:REAL; ExtrudeHd	:HANDLE; F_Shape,F_Class	:STRING):HANDLE;
VAR
F_NurbsHd	:HANDLE;
bStart, bLinear	:BOOLEAN;
ExtendDistance	:REAL;
Thickness	:REAL;
h1,h2,SubstractHd	:HANDLE;
BEGIN
F_NurbsHd:=F_ConvertPathToNURBS(F_PathHd,FALSE,1);

IF F_Class <> '' THEN SetClass(ExtrudeHd,F_Class);

begingroup;
	F_NurbsHd:=CreateExtrudeAlongPath(F_NurbsHd,ExtrudeHd);
endgroup;
delobject(ExtrudeHd);

F_ExtrudeAlongPath:=F_NurbsHd;
END;

I don't really see anything wrong codewise. Is it possible that when creating a nurbs the path can rotate along itself ? Is there a funtion that gives that rotation ?

Edited by hippothamus
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...