Assembly Posted June 11, 2010 Share Posted June 11, 2010 VSFR has a good replacement for hExtrude. How Orso figured this out to start with is genius. { ***************************************** } { Orso.B.Schmid, creates an extrude from a HANDLE h, preserving the original h. Returns a handle to the extrude } FUNCTION Create3Dobj(h: HANDLE; z, dZ: REAL): HANDLE; BEGIN IF h <> NIL THEN BEGIN BeginXtrd(z, dZ); LineTo(1, 1); { just draw something for creating an extrude container } EndXtrd; DelObject(FIn3D(GetParent(CreateDuplicateObject(h, LNewObj)))); { places a copy of h in the extrude and deletes the line } Create3Dobj := LNewObj; END; END; BUT there is a minor bug in the code above. The object extrude uses LineTo(1,1); If the cursor is already at (1,1) then the line is not drawn and the extrude is not created. Easy fix is this: { ***************************************** } { Orso.B.Schmid, creates an extrude from a HANDLE h, preserving the original h. Returns a handle to the extrude } FUNCTION Create3Dobj(h: HANDLE; z, dZ: REAL): HANDLE; BEGIN IF h <> NIL THEN BEGIN BeginXtrd(z, dZ); MoveTo(0,0); LineTo(1, 1); { just draw something for creating an extrude container } EndXtrd; DelObject(FIn3D(GetParent(CreateDuplicateObject(h, LNewObj)))); { places a copy of h in the extrude and deletes the line } Create3Dobj := LNewObj; END; END; Orso If your out there you might update VSFR. Thanks Quote Link to comment
_c_ Posted June 11, 2010 Share Posted June 11, 2010 Ciao Assembly, you are right, if the mouse is already at 1,1 then the routine fails with handle NIL. I fixed now the sub-routine using relative: http://www.vectorlab.info/index.php?title=Han-Create_3D_object. I can't fix also VSFR of Charles since is not editable any longer, but I fixed the entry in the Developer list (which copied the entries made on VSFR by Charles in April 2008). thank you! orso Quote Link to comment
Assembly Posted September 22, 2010 Author Share Posted September 22, 2010 (edited) Here is an extension to Orso's function this allows you to pass a group of profiles into the extrude container. I have not tested much so use at own risk. There should probably be a test routine to make sure only extrude able objects are in the group. The code has been deleted as requested... Edited September 27, 2010 by Ray Libby Quote Link to comment
_c_ Posted September 26, 2010 Share Posted September 26, 2010 Justin, please edit that routine: it is awfully dangerous. I don't understand what you are trying to do there, part of the code is missing, you seem to wish a recursion, but this is just not the thing. Don't publish things if you are not sure. Some might use it and have troubles, which is certainly not what you wish. Also you can get rid of the "moveTo" in my sub, you can use "Line(1, 1);" which, being relative to whatever position the mouse had, never poses problems. If you want to pass a group of profiles, you simply loop down the objects one by one. orso Quote Link to comment
Assembly Posted September 27, 2010 Author Share Posted September 27, 2010 Orso. I have not had any issue with it... But I will remove as suggested. The reason I pass in the group of profile is for ease of editing latter. The function I use this in is a menu call that allows me to select a 2D shape on screen, and input a profile shape to extrude. This creates a 3D solid intersection. have been using the method you suggest, cycling, but when I go to make an alteration to the object outside of the script I was getting 20 planks that need to be edited. By sending a group of handles into the extrude container I have one object to intersect that mimics the way I would model outside of scripting. Quote Link to comment
Assembly Posted September 27, 2010 Author Share Posted September 27, 2010 Orso The edit button is gone from the above post. I suggested to the moderator that it is edited on your advise. 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.