PDA

View Full Version : Mold and slices


AnoPrkl
11-28-2010, 08:07 PM
I'm trying to do kind of a mold which is 4 point plane (editable poly or mesh) that slices through object underneath it. So it keeps the edges and vertices like in the object underneath it. I attached image for better explanation what i mean.
Here is my code so far, it just does the slices but doesn't delete unneeded faces around cuts. I think there is some problems with the code because it seemed to do some faulty slices sometimes. Any ideas is there easier or better way to do this? :)

(
local base = copy $Plane01
local cutter = $Plane06
local edgeCount = polyop.getNumEdges cutter
for i = 1 to edgeCount do
(
local edgeVertices = (polyop.getVertsUsingEdge cutter i) as array
local v1 = polyop.getVert cutter edgeVertices[1]
local v2 = polyop.getVert cutter edgeVertices[2]
local norm = normalize(cross v1 v2)
local cent =((v1 + v2) / 2) - base.center
local slic = (base.slice norm [cent.x, cent.y, 0])
)
)

denisT
11-28-2010, 08:51 PM
i would use Face Extrude and ProCutter (see mxs help for details)

AnoPrkl
11-29-2010, 05:55 AM
Thanks denis, I did some testing with ProCutter and but i get some messy polygons with it. I also tried ProBoolean and got little better results but still some extra vertices in mesh. I'll try if I can do some cleaning afterwards.

I think problem with ProCutter is that if the object i want to cut is plane, it doesnt work really well

AnoPrkl
12-10-2010, 06:52 AM
Well ProBoolean didn't work like i thought it would. Couldn't get good results with ProCutter either. Anyone got suggestions how should i go with this?

denisT
12-10-2010, 07:25 PM
Well ProBoolean didn't work like i thought it would. Couldn't get good results with ProCutter either. Anyone got suggestions how should i go with this?

http://forums.cgsociety.org/showpost.php?p=6797072&postcount=1
ProBoolean and ProCutter also work... just believe me.

AnoPrkl
12-14-2010, 09:16 AM
Thanks for that denisT! I used different kind of approach where I extrude target objects edges and then apply boolean for mold. It does now what i want, although extruding edges using buttonop is kinda annoyning because of the constant modify panel updates. And I can't get the undo context working properly either :cool:

Anyway I needed this kind of script to place decals (graffitis, dirt etc.) to scene. Our decals are usually created with couple polygons (no height) and UV-mapped. When decal is placed to target object, it conforms to the shape of the target object. Thats why I needed to create extra edges to the decal so conform happens properly.

I was thinking could this be done in realtime? You could select your decal, move it around in scene and it automatically projects decal to the surface under mouse cursor, then you click your mousebutton and your decal is placed. But I think it might be impossible to do realtime because of booleans.

I know I can use mousetrack to move the object and get direction of underlying surface and stuff, but is there a way I could project the decal texture to the underlying surface (and the texture would "conform" the underlying surface), so i wouldn't need to do the actual geometry until mouse click?

CGTalk Moderation
12-14-2010, 09:16 AM
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.