View Full Version : Knife > cut and instantly make 2 objects?
rizon 07-08-2008, 12:02 PM Hello,
Is there a way to cut for instance a cube and instantly make 2 objects out of it...
Thanks!
|
|
Zmurowski
07-08-2008, 12:22 PM
No. But you can cut it, than select one of the "halves" and use split command - you will then get a coplete object, and a separate one with only the polygons which you selected and applied split command to.
rizon
07-08-2008, 12:26 PM
Split is an option, but too time consuming... when using split, you still have to close polygon holes...
soccerrprp
07-08-2008, 12:40 PM
this would be a nice little coffee script idea for someone... try posting in a request for a script that will do this or most of this for you in the scripting sub-forum
i think that it would be a nice work-flow tool for many...:thumbsup:
Richard
Darter
07-08-2008, 01:20 PM
It would be fairly easy to create a script to disconnect the halves of a knifed six-poly cube and close the holes. The knife cut would just need to be selected when running the script.
Automatically applying the Close Polygon Hole tool won't work using a script, as editor input is required. For a more complex mesh, any automatic capping would have to make mesh arrangement assumptions. This is the sort of thing I always do manually.
Someone else may be able to offer a different approach.
arkitekto
07-08-2008, 01:41 PM
Another solution would be duplicating the cube and using boole objects to split them.
rizon
07-08-2008, 01:43 PM
It would be fairly easy to create a script to disconnect the halves of a knifed six-poly cube and close the holes. The knife cut would just need to be selected when running the script.
that indeed would be great!
otomo
07-08-2008, 02:03 PM
It would be fairly easy to create a script to disconnect the halves of a knifed six-poly cube and close the holes. The knife cut would just need to be selected when running the script.
To me it sounds first like an easy task, but when you start to think on it it becomes more and more complicated.
How would be your approach to disconnect one half? To do that you would have to define a set of polygons, which are one one side of the cut. How to do that?
I am just a coffee apprentice and I am willing to learn.
Darter
07-08-2008, 02:43 PM
The points with the last 4 indices will be those from the knife cut. For a simple knifed cube they should be on the same plane. These points are used to create a custom matrix. If e.g. the Y axis of this matrix is perpendicular to the plane of the points, all points at Y >= 0 in custom matrix space are selected. This selection is converted polys and the Disconnect command is executed. The VariableChanged class is used to cap each half, using the last 4 point indices for one half and the next lowest 4 for the other half. If desired, the Split command can be used to create a separate object and the duplicate polys deleted.
I'm retiring now but if I have time tomorrow, I'll have a stab at coding the script. If your COFFEE skills permit, feel free to have a go in the meantime.
AdamT
07-08-2008, 03:23 PM
Someone posted a script called "Full Split" some time ago -- maybe Darter? Anyway, I use it all the time. Basically it does the same thing as the split command, but instead of leaving the original object it creates an object from the split and another object without the split parts. Not exactly what you want but an improvement.
Jinxer
07-08-2008, 03:37 PM
Hi! I believe the script AdamT is refering to can be found in this thread (http://forums.cgsociety.org/showthread.php?t=289449) . :thumbsup:
Cheers!
otomo
07-08-2008, 03:52 PM
The points with the last 4 indices will be those from the knife cut. For a simple knifed cube they should be on the same plane. These points are used to create a custom matrix. If e.g. the Y axis of this matrix is perpendicular to the plane of the points, all points at Y >= 0 in custom matrix space are selected. This selection is converted polys and the Disconnect command is executed. The VariableChanged class is used to cap each half, using the last 4 point indices for one half and the next lowest 4 for the other half. If desired, the Split command can be used to create a separate object and the duplicate polys deleted.
I'm retiring now but if I have time tomorrow, I'll have a stab at coding the script. If your COFFEE skills permit, feel free to have a go in the meantime.
yes, that sounds like it should work. a nice task for a coffee learner. i see what i can achieve.
arkitekto
07-08-2008, 04:54 PM
It would be fairly easy to create a script to disconnect the halves of a knifed six-poly cube and close the holes. The knife cut would just need to be selected when running the script.
Automatically applying the Close Polygon Hole tool won't work using a script, as editor input is required. For a more complex mesh, any automatic capping would have to make mesh arrangement assumptions. This is the sort of thing I always do manually.
Someone else may be able to offer a different approach.
Just wanted to point out that splitting a polygon object via the boole object will automatically close the polygon hole as well.
jackb602
07-08-2008, 08:25 PM
This would be a great feature to have in Cinema. FormZ has a tool that does this, and I use it constantly. Basically, you can use a spline to slice an object into two pieces, all in one step.
Darter
07-10-2008, 12:40 PM
Just wanted to point out that splitting a polygon object via the boole object will automatically close the polygon hole as well.
Good point, thanks for the suggestion. I've incorporated a boole operation into a script which splits an object along a seam to create two objects with capped holes.
As there was some interest in the approach to creating such a tool with COFFEE, I've added copious comments.
I've tested the script on various meshes and it seems to work okay but I'm expecting that some refinements will be necessary. Feedback to help improve the script would be appreciated.
Instructions and notes are in the script and Readme file.
EDIT: Script updated to fix undo/redo error.
rizon
07-10-2008, 01:07 PM
Fantastic! explodings to come... ;-)
soccerrprp
07-10-2008, 01:11 PM
Darter,
That is cool! Will be using it often...how difficult is it to create a script that is not restricted to co-planar points? Like making irregular/non-co-planar cuts through an object and then splitting...
Thank you!
Richard
I am currently working on a architectural curriculum for my high school students for the fall and this script will certain be one of the tools used!
Darter
07-10-2008, 02:00 PM
Thanks for the fast feedback guys. Be sure to grab the updated version (1.1).
soccerrprp: a version based on other than coplanar points would take some time and brain-racking but I'm sure that it's doable.
JoelOtron
07-10-2008, 02:42 PM
Wow darter--this is great--thanks for this.
Not to look a gift horse in the mouth , buuuut.... :)
I guess the only way it could be better would be for the caps to be generated with better topology in case you need to smooth the geometry. For instance when I cut a sphere in half, it makes 2 halves--but it would be great if the cap polys were arranged (somehow, via magic) in proper loops, or the polys radiated to a central point dead center of the sphere half. Probably not possible or will be very labor intensive.
Anyway--thanks again for another great script!
Joel
Darter
07-11-2008, 01:44 PM
Not to look a gift horse in the mouth , buuuut.... :)
I guess the only way it could be better would be for the caps to be generated with better topology in case you need to smooth the geometry. For instance when I cut a sphere in half, it makes 2 halves--but it would be great if the cap polys were arranged (somehow, via magic) in proper loops, or the polys radiated to a central point dead center of the sphere half. Probably not possible or will be very labor intensive.
No horsiness taken at all.
The boole operation invoked by the script produces similar results to the Close Polygon Hole tool. The cap of e.g. a sliced sphere could be neatly arranged by applying a subdivided inner extrude and merging the central ring of points. Coding a tool to create neat topology for irregularly shaped objects would be much more difficult.
prayas
07-11-2008, 02:24 PM
sorry for asking a really stupid question in thei great thread. How do i use a script / this script? I really never did all the years i 've been using c4d.
P..:
EDIT::
Nevermind. Stupid of me, Just place it right under library/scripts
JoelOtron
07-11-2008, 02:32 PM
No horsiness taken at all.
The boole operation invoked by the script produces similar results to the Close Polygon Hole tool. The cap of e.g. a sliced sphere could be neatly arranged by applying a subdivided inner extrude and merging the central ring of points. Coding a tool to create neat topology for irregularly shaped objects would be much more difficult.
Thanks Darter. I figured it didnt hurt to ask. :)
PRAYAS: once youve moved the script to the library open your script manager (window->script manager) ---in case you didnt know where it was.
CGTalk Moderation
07-11-2008, 02:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.