[Closed] Convert checker map to planes
Is it possible to convert a checker map applied to an object to planes? I want to apply a checker map into an object and then have planes in the exact same places of each checker… dont know how to do this thow… Thanks in advance.
TileLengthX,Y,Z = UVWGizmoGlobalLengthX,Y,X / (UVW TileX,Y,Z * Map TileX,Y,Z * 2)
TotalX,Y,ZSlices=((BoxLengthX,Y,Z/TileLengthX,Y,Z)+1)
Determine the offset of the UVW Gizmo. Figure out where the first checker “loop” begins. The “min” if you will.
Then use code similar to this to slice and detach the mesh. (rinse repeat for each new slice for all 3 dimensions).
macroScript Julliene
category:"Pongoloid"
buttonText:"Julienne"
toolTip:"Julienne"
(
undolabel = "Julienne"
rollout julienne "Julienne"
(
checkbox Xcheck "X"
checkbox Ycheck "Y"
checkbox Zcheck "Z"
spinner XSpin type:#integer range:[2,100,2] pos:[45,5]
spinner YSpin type:#integer range:[2,100,2] pos:[45,24]
spinner ZSpin type:#integer range:[2,100,2] pos:[45,44]
button dice "Dice" pos:[120,5] height:55
on dice pressed do
(
try
(
undo label:undolabel on
(
p = (selection as array)[1]
zeroed = quat 0 0 0 1
sticker = p.rotation
p.rotation = zeroed
SliceMin = p.min
SliceMax = p.max
if xcheck.checked == true then
(
xchops = xspin.value
)
else
(
xchops = undefined
)
if ycheck.checked == true then
(
ychops = yspin.value
)
else
(
ychops = undefined
)
if Zcheck.checked == true then
(
zchops = zspin.value
)
else
(
zchops = undefined
)
if xchops != undefined then
(
slicelen = slicemax-slicemin
slicelen = slicelen/xchops
for i = 1 to (xchops-1) do
(
slicepoint = [(slicemin.x+(i*slicelen.x)), (slicemin.y+(i*slicelen.y)), (slicemin.z+(i*slicelen.z))]
p.slice [1,0,0] (slicepoint-p.pos)
)
)
if ychops != undefined then
(
slicelen = slicemax-slicemin
slicelen = slicelen/ychops
for i = 1 to (ychops-1) do
(
slicepoint = [(slicemin.x+(i*slicelen.x)), (slicemin.y+(i*slicelen.y)), (slicemin.z+(i*slicelen.z))]
p.slice [0,1,0] (slicepoint-p.pos)
)
)
if zchops != undefined then
(
slicelen = slicemax-slicemin
slicelen = slicelen/zchops
for i = 1 to (zchops-1) do
(
slicepoint = [(slicemin.x+(i*slicelen.x)), (slicemin.y+(i*slicelen.y)), (slicemin.z+(i*slicelen.z))]
p.slice [0,0,1] (slicepoint-p.pos)
)
)
p.rotation = sticker
) -- end Undo
) -- end try
catch (messagebox "Something went wrong. Make sure it's an editable poly.")
) -- end on "Dice"
)
createdialog julienne
)
I would then take all of the slices and arrange them in an array based on their position. Determine if the first slice was within the first color if the min/min/min object’s minimum is < (tile size + slice origin point) or the second color. Get the map for each checker color and apply properly. (Make sure all the slices have shared UVW Map coordinates).
That should let you extract the checkers from any arbitrary object not just Cubes and planes.
Thanks thatoneguy but I was thinking if it wasnt more effective creating planes rather than slicing the mesh. For example, create a plane in front of an object, find out the correct dimensions of the plane based on the checker size, subdivide the plane and then projecting the plane into the mesh, very much like conform compound object does but better and based on the object uvw and checker map applied.