Script advice?
All  1-20

Next
 From:  Paul (AIRGLASS)
965.1 
Hi Michael,
I'm trying to put together yet another convenience script, but yet again I'm stuck!
The idea is to be able to split an object quickly using a point picked on the object as the cutting location,
generate a line, extrude a plane and use the plane to split the object using boolean diff. (I reused alot of the code from your CSec script). Anyway, every thing works well up until the boolean operation, at which point nothing happens. I'm assuming that I'm not referencing the plane I create correctly, when I use it as input for
Booleanfactory.setInput( 1, Cuttingplane ); , but I have no idea at this point. The cutting plane is set up as var Cuttingplane = PlaneList.item(0); Any advice on what I'm doing wrong?

Thanks,
Paul
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
965.2 In reply to 965.1 
Hi Paul, give the attached version a try. You were 99% of the way there, just a couple of quirks at the end - the input to the boolean must be an ObjectList, not an individual object.

Also, another quirk is that the objects used in the boolean have to be added to the geometry database first so they get a unique ID assigned to them.

These are things that I can tune up later, like it would be a convenient thing if a factory could take either an object list or an actual single object interchangably, and the IDs could be assigned automatically in this situation.

This stuff hasn't been quite refined for complete convenience like this yet.

But it seems like the overall "factory" architecture is working out really well, it basically allows you to automate the actual guts behind every regular command.

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
965.3 In reply to 965.2 
Hi, Michael,
Thanks for the help -- yes, the more I learn about how MoI commands, etc., work -- the more I appreciate possibilities for scripting commands. The factory mechanism is working out well. I think I'm starting to get the hang of it (at least a little bit :) ).
Now, let's see...... what kind of trouble can I get myself in next!

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
965.4 In reply to 965.3 
Hi all,
Here's the final versions of the script I was working on that somebody else might find handy (Thanks to Michael for his help!).
QuickSplit_XYZ cuts an object along an axis defined on the
script command line.
To set it up: add the script to the moi/commands directory,
hook it up to a hotkey in MoI's options dialog, with the script command
< QuickSplit_XYZ X (or Y or Z)>, separate the parameter by a space
from the command. To use: pick an object, hit your hotkey, and pick a cutting
location on the object. It will be split at that location
along the specified axis.
QuickSplit_Angle works the same way, no parameters needed, but will split
an object along an angled line defined by 2 picked points. (pick the object,
hit your hotkey, pick 1st point, pick 2nd point, object is cut.)
Both scripts are intended for use in the Top, Front, and Right viewports.

Paul
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
965.5 In reply to 965.4 
Can you put an image of this new function with an object before / after ?
---
Pilou
Is beautiful that please without concept!
My Gallery
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
965.6 In reply to 965.5 
Hi Pilou,
Imagine a cube sliced into 2 parts by the script. That's all it is, just a quick convenience function to slice and dice an object up real fast. One use for it is if you have a model with internal parts and want to get a quick look at something inside - split the model, take a quick look, hit undo and you're back to where you started. Another use might be to make a quick cross-section of a model or to chop a section out of a model by splitting the model in 2 places and deleting the section.
Hope that helps!

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
965.7 In reply to 965.6 
Thx for the explanation
I will try it :)
PS You have not written what we must write for the Angle in column of the Shortcut

Pss an you must write for the first for example
Alt+X QuickSplit_XYZ X
Alt+Y QuickSplit_XYZ Y
Alt+Z QuickSplit_XYZ Y

becauce I have written QuickSplit_XYZ X (y or Z) and nothing work !!! :)
---
Pilou
Is beautiful that please without concept!
My Gallery

EDITED: 30 Sep 2007 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
965.8 In reply to 965.7 
Hi Pilou.
"because I have written QuickSplit_XYZ X (y or Z) and nothing work !!! :)"
Good point! :) I should have been more clear -- it's:
QuickSplit_XYZ X
QuickSplit_XYZ Y
QuickSplit_XYZ Z

For the Angle script there is no parameter to enter. The angle is chosen by where you place your 2 points on the model.

Paul

PS --
After playing around with QuickSplit_Angle for awhile I realized Pilou was thinking "angle as defined by a specified angle". Turns out there is a way to do that with this script:
Pick your object, hit your hotkey, pick the location you want the split to run thru, go to the angle box at the bottom of the gui and enter a number for the amount of precision you need for the angle, that turns on snapping set to that precision. Then pick your 2nd point on the model, after moving the pointer around until you get the angle you want. The split will be done at the specified angle. In other words, if you want a split at 45 degrees, enter 5 in the angle box and snapping will happen at increments of 5 degrees. If you want 22.5 degrees, type in 0.5, snapping sets to 0.5 degree increments.
The more I use MoI, the more I realize how well thought out Michael's design is!

EDITED: 30 Sep 2007 by AIRGLASS

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
965.9 In reply to 965.8 
That works fine :)
But I dont understand why you have 2 scripts?
Split_Angle with Snap Direct enable can make the same than QuickSplit_xyz (and more of course) :)
So I have erased QuickSplit_xyz and keept Split_Angle who is very useful indeed :)
---
Pilou
Is beautiful that please without concept!
My Gallery

EDITED: 30 Sep 2007 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
965.10 In reply to 965.9 
Yes, I realized that too, after I used it awhile.
The Angle script is all that's needed. :) Oh, well, learned a little more about MoI's scripting in the process...

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  christian (CHRI)
965.11 In reply to 965.10 
hi Michael

Does the SPLIT script work with MoI 5.0 beta Apr-8-2023 to obtain section like the example ?

Or have you planned a "section view" function ?

thanks

Christian

EDITED: 10 Aug 2023 by CHRI

Image Attachments:
Size: 182.1 KB, Downloaded: 16 times, Dimensions: 794x663px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
965.12 In reply to 965.11 
Hi Chri,

re:
> Does the SPLIT script work with MoI 5.0 beta Apr-8-2023 to obtain section like the example ?

I'm not familiar with the "split" script, can you show me where that is located?

But you can use the regular boolean difference command to make a cut like that.

Draw in your parting line like this:


Select the objects and run Construct > Boolean > Difference. Then select the line at the cutting object:






> Or have you planned a "section view" function ?

I would like to have a section view function but I'm not sure when it will happen.

- Michael

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
965.13 In reply to 965.11 
You can also use Construct > Curve > Project to project a line onto objects which will generate section cut curves:



- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  christian (CHRI)
965.14 In reply to 965.13 
Hi Michael
Thanks for your quick answers

-----------------------------------------------------------------------------------------------------------
I'm not familiar with the "split" script, can you show me where that is located?

you can find the link here :
http://kyticka.webzdarma.cz/3d/moi/
function : Quick Splitting

beginning of the discussion
http://moi3d.com/forum/index.php?webtag=MOI&msg=965.1
-----------------------------------------------------------------------------------------------------------
But you can use the regular boolean difference command to make a cut like that.

boolean difference is the function i have used
but we have to do as many Boolean operations as there are parts to be cut
the result is nice and it's a 3D section
-----------------------------------------------------------------------------------------------------------
you can also use Construct > Curve > Project to project a line onto objects which will generate section cut curves:

this function is simple and fast but the result is now a 2D section
-----------------------------------------------------------------------------------------------------------


it would be nice to cut a group of parts with a plan or a line in one time then select between the 2 groups which one should be masked.

christian

EDITED: 14 Apr 2023 by CHRI

Image Attachments:
Size: 50.5 KB, Downloaded: 7 times, Dimensions: 479x609px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
965.15 In reply to 965.14 
Hi christian,

re:
> boolean difference is the function i have used
> but we have to do as many Boolean operations as there are parts to be cut
> the result is nice and it's a 3D section

Sorry, I'm not understanding this part. You can select all the objects and do just one boolean, you don't need to do them one at a time.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  christian (CHRI)
965.16 In reply to 965.15 
hi Michael

Sorry, I'm not understanding this part. You can select all the objects and do just one boolean, you don't need to do them one at a time.

you are right Michael
i made a mistake, i have used merge function instead diff function

it works fine with merge function

Sorry.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  christian (CHRI)
965.17 In reply to 965.16 
Hi
an example cut by polyline ( gif file)

Thanks Michael
Image Attachments:
Size: 243.9 KB, Downloaded: 14 times, Dimensions: 441x383px
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
965.18 In reply to 965.17 
A simple Boolean Diff Box don't make the trick ?
so here as you have a polyline...an extruded polyline ;)

EDITED: 15 Apr 2023 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  christian (CHRI)
965.19 In reply to 965.18 
hi Pilou

You're right, I didn't think you could simply subtract a solid; it was too easy!
In MOI, everything is easier than in other software!
Thanks


Bonjour Pilou

Tu as raison, il ne m'est pas venu a l'esprit que l'on pouvait tout simplement soustraire un solide; trop simple
Dans MOI, tout est plus facile que dans les autres logiciels !
Merci

christian

EDITED: 16 Apr 2023 by CHRI

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Frenchy Pilou (PILOU)
965.20 In reply to 965.19 
:)

Normally a polyline under (upper) the volumes should make also the Boolean Diff...
but use "planes" help a little more to see where the cut will be made and also the prog in complexe cases! :)

EDITED: 16 Apr 2023 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-20