Jump to content
Developer Wiki and Function Reference Links ×

hExtrude replacement.


Recommended Posts

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

Link to comment
  • 3 months later...

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 by Ray Libby
Link to comment

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

Link to comment

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.

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