SamIWas Posted February 4, 2018 Share Posted February 4, 2018 I am trying to do a very simple extrude along path in Vectorscript to basically make a square or circle tube box. When drawing, I simply create a rectangle for the path, a rectangle or circle for the profile, and run "Extrude Along Path". I have managed to get Vectorscript to make the object, but I'm running into a few problems: 1. It seems to draw these things on screen plane rather than using basic world coordinates. I tried setting the plane, but that didn't appear to do anything. 2. It leaves the 2D objects there. This is a test section of code. It should create an 80x80 box of 2" square tube. It does, but it is always perpendicular to the camera, and not flat on "ground level". I tried using "SetWorkingPlace". I know I'm doing something wrong, or leaving something out. Any leads? Rect(-40,40,40,-40); struc1:=ConvertToNURBS(LNewObj,FALSE); Rect(-1,1,1,-1); struc2:= LNewObj; struct:=ExtrudeAlongPath(struc1,struc2); Move3DObj(struct,0,0,10); Quote Link to comment
Pat Stanford Posted February 4, 2018 Share Posted February 4, 2018 Check and see if the CreateCustomObjectPath command is more to your liking. It will make a solid object instead of a bunch of surfaces. It is a newer command and more likely to work they way you are asking for. Quote Link to comment
SamIWas Posted February 5, 2018 Author Share Posted February 5, 2018 6 hours ago, Pat Stanford said: Check and see if the CreateCustomObjectPath command is more to your liking. It will make a solid object instead of a bunch of surfaces. It is a newer command and more likely to work they way you are asking for. I couldn't figure out how to make that one work at all. I have managed to get the strange rotation issues dealt with by using 3D polys as the path and profile instead of rectangles. But I still can't get them to go away once the extrude is made. I'm left with the extrude and floating polygons. Quote Link to comment
AlanW Posted February 5, 2018 Share Posted February 5, 2018 @SamIWasSeems to work in 2018 simple rectangles x 2 and EAP. attached 2016 file to see if any issues. HTH EAP.vwx Quote Link to comment
SamIWas Posted February 5, 2018 Author Share Posted February 5, 2018 4 hours ago, Alan Woodwell said: @SamIWasSeems to work in 2018 simple rectangles x 2 and EAP. attached 2016 file to see if any issues. HTH EAP.vwx No issues with the Extrude Along Path tool itself. It's when I run it through Vectorscript that I can't seem to make the original shapes disappear. Quote Link to comment
MullinRJ Posted February 5, 2018 Share Posted February 5, 2018 19 hours ago, SamIWas said: I have managed to get Vectorscript to make the object, but I'm running into a few problems: 1. It seems to draw these things on screen plane rather than using basic world coordinates. I tried setting the plane, but that didn't appear to do anything. 2. It leaves the 2D objects there. Hello Sam, Problem 1, either draw your 2D objects directly on the Layer (GND) Plane, or move them there after they are created. Problem 2, requires manual clean up. I modified your script to address both problems. PROCEDURE EAPOnGndPlane; VAR struc, struc1, struc2 :Handle; BEGIN Rect(-40, 40, 40, -40); SetObjectVariableBoolean(LNewObj, 1160, FALSE); { Move PathRECT to Ground Plane } struc1 := ConvertToNURBS(LNewObj, FALSE); Rect(-1, 1, 1, -1); struc2 := LNewObj; SetObjectVariableBoolean(struc2, 1160, FALSE); { Move ProfileRECT to Ground Plane } struc := ExtrudeAlongPath(struc1, struc2); Move3DObj(struc, 0, 0, 10); { elevate EAP } { Clean up } DelObject(struc1); DelObject(struc2); if (struc <> nil) then SysBeep; { APPLAUSE!!! } END; Run(EAPOnGndPlane); HTH, Raymond Quote Link to comment
SamIWas Posted February 6, 2018 Author Share Posted February 6, 2018 Thanks everyone for making me think. I got it all working. The original problem was not drawing on the "ground". That as fixed by either using 3D polys, or using the 1160 variable. Then, I couldn't get the polys to go away. That was fixed with the DelObject calls, which for some strange reason, I missed. Quote Link to comment
_c_ Posted May 12, 2018 Share Posted May 12, 2018 Hello, by chance I stumbled upon this discussion. I know it's late but it might save a lot of searches later for others. You must "flatten" the path object, you can also use SetPlanarRefIDToGround. Example: RectangleN(x, y, 1, 0, w, h); pathObj := LNewObj; SetFPat(pathObj, 0); SetPlanarRefIDToGround(pathObj); { without this, your ExtrudeAlongPath will be extruded along any view you happen to be in } pathObj := ConvertToNURBS(pathObj, FALSE); obj := ExtrudeAlongPath(pathObj, profileObj); { profile object is a poly, rect, oval etc. } Quote Link to comment
Recommended Posts
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.