Notifications
Clear all

[Closed] Mold and slices

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])
      )
  )
5 Replies

i would use Face Extrude and ProCutter (see mxs help for details)

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

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?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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

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

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?