Split Mesh with decal?

Sorry I am not explaining it well. But my earlier example did tried to show this except at that point I did not understand where the mesh was. Hopefully it goes better for you now.

Now I got the following error message :

bild

…and the mesh disappeared or shrank into a few dots:
bild

… and a very long log record in the commad window:

    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 65.5009 sec
    For closed curve with 836 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0800 sec
    For closed curve with 779 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0380 sec
    Found 2 segments with 1,617 total points and 0 corner points
    Information: Curve with endpoints -137833.64, -1584197.68, -1405.72 and 1133347.74, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 2783673.61, 1186806.38, -9430.63 and 1512491.31, -1584199.75, -8774.57 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 74.6079 sec
    For closed curve with 785 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0440 sec
    For closed curve with 751 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0370 sec
    Found 2 segments with 1,538 total points and 0 corner points
    Information: Curve with endpoints -247853.51, -1584197.31, 9551.97 and 1023327.73, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 2893694.17, 1186806.38, -9430.63 and 1622511.84, -1584199.75, -8771.44 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 83.9481 sec
    For closed curve with 822 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0460 sec
    For closed curve with 791 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0590 sec
    Found 2 segments with 1,615 total points and 0 corner points
    Information: Curve with endpoints 913307.24, 1186806.38, -9430.63 and -357875.14, -1584199.75, 7037.11 could not be closed.
    Information: Curve with endpoints 3003714.47, 1186806.38, -9430.63 and 1732532.20, -1584199.75, -8776.59 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 93.2737 sec
    For closed curve with 858 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0450 sec
    For closed curve with 832 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0430 sec
    Found 2 segments with 1,692 total points and 0 corner points
    Information: Curve with endpoints 803286.62, 1186806.38, -9430.63 and -467895.67, -1584199.75, 3718.39 could not be closed.
    Information: Curve with endpoints 3113734.54, 1186806.38, -9430.63 and 1842552.25, -1584199.75, -8784.33 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 102.5310 sec
    For closed curve with 876 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0450 sec
    For closed curve with 831 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0510 sec
    Found 2 segments with 1,709 total points and 0 corner points
    Information: Curve with endpoints -577915.65, -1584199.63, 3378.73 and 693266.61, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 3223754.76, 1186806.38, -9430.63 and 1952572.50, -1584199.75, -8771.41 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 111.7493 sec
    For closed curve with 911 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0530 sec
    For closed curve with 809 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0480 sec
    Found 2 segments with 1,722 total points and 0 corner points
    Information: Curve with endpoints 583246.30, 1186806.38, -9430.63 and -687935.98, -1584199.75, -11.52 could not be closed.
    Information: Curve with endpoints 3333775.17, 1186806.38, -9430.63 and 2062592.83, -1584199.75, -8782.57 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 121.0063 sec
    For closed curve with 782 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0430 sec
    For closed curve with 725 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0510 sec
    Found 2 segments with 1,509 total points and 0 corner points
    Information: Curve with endpoints 473226.10, 1186806.38, -9430.63 and -797956.13, -1584199.48, -1468.14 could not be closed.
    Information: Curve with endpoints 3443795.39, 1186806.38, -9430.63 and 2172613.08, -1584199.75, -8772.87 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 130.3153 sec
    For closed curve with 739 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0370 sec
    For closed curve with 687 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0340 sec
    Found 2 segments with 1,428 total points and 0 corner points
    Information: Curve with endpoints 363205.80, 1186806.38, -9430.63 and -907976.45, -1584199.58, -8715.08 could not be closed.
    Information: Curve with endpoints 3553815.61, 1186806.38, -9430.63 and 2282633.33, -1584199.75, -8775.87 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 139.4043 sec
    For closed curve with 731 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0570 sec
    For closed curve with 503 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0250 sec
    Found 2 segments with 1,236 total points and 0 corner points
    Information: Curve with endpoints 253185.50, 1186806.38, -9430.63 and -1017996.80, -1584199.75, -9994.39 could not be closed.
    Information: Curve with endpoints 3663836.02, 1186806.38, -9430.63 and 2392653.66, -1584199.75, -8770.49 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 148.6413 sec
    For closed curve with 702 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0400 sec
    For closed curve with 459 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0270 sec
    Found 2 segments with 1,163 total points and 0 corner points
    Information: Curve with endpoints 143165.30, 1186806.38, -9430.63 and -1128017.08, -1584199.75, -9994.40 could not be closed.
    Information: Curve with endpoints 3773856.24, 1186806.38, -9430.63 and 2502673.91, -1584199.75, -8769.47 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 157.8393 sec
    For closed curve with 733 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0400 sec
    For closed curve with 472 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0430 sec
    Found 2 segments with 1,207 total points and 0 corner points
    Information: Curve with endpoints 33145.00, 1186806.38, -9430.63 and -1227193.17, -1560560.90, -9977.84 could not be closed.
    Information: Curve with endpoints 3883876.46, 1186806.38, -9430.63 and 2612694.16, -1584199.75, -8772.32 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 167.1353 sec
    For closed curve with 730 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0390 sec
    For closed curve with 469 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0290 sec
    Found 2 segments with 1,201 total points and 0 corner points
    Information: Curve with endpoints -76875.30, 1186806.38, -9430.63 and -1227193.25, -1320731.71, -9835.34 could not be closed.
    Information: Curve with endpoints 3993896.95, 1186806.38, -9430.63 and 2722714.60, -1584199.75, -8763.92 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 176.3183 sec
    For closed curve with 671 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0350 sec
    For closed curve with 596 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0450 sec
    Found 2 segments with 1,269 total points and 0 corner points
    Information: Curve with endpoints -186895.34, 1186806.38, -9430.63 and -1227193.25, -1080902.82, -9835.34 could not be closed.
    Information: Curve with endpoints 4103917.17, 1186806.38, -9430.63 and 2832734.85, -1584199.75, -8782.08 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 185.6166 sec
    For closed curve with 737 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0370 sec
    For closed curve with 675 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0400 sec
    Found 2 segments with 1,414 total points and 0 corner points
    Information: Curve with endpoints -296915.63, 1186806.38, -9430.63 and -1227193.25, -841073.46, -9835.34 could not be closed.
    Information: Curve with endpoints 2942755.10, -1584199.75, -8808.95 and 4172987.50, 1097541.14, -11195.58 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 194.7828 sec
    For closed curve with 689 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0460 sec
    For closed curve with 627 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0310 sec
    Found 2 segments with 1,318 total points and 0 corner points
    Information: Curve with endpoints -406935.93, 1186806.38, -9430.63 and -1227193.25, -601244.08, -9835.34 could not be closed.
    Information: Curve with endpoints 3052775.21, -1584199.63, -6398.37 and 4172987.50, 857712.21, -11195.58 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 204.0228 sec
    For closed curve with 651 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0330 sec
    For closed curve with 564 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0310 sec
    Found 2 segments with 1,217 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, -361415.24, -9835.34 and -516955.95, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 3162795.75, -1584199.61, -6014.19 and 4172987.50, 617882.23, -11195.58 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 213.1881 sec
    For closed curve with 666 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0460 sec
    For closed curve with 505 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0310 sec
    Found 2 segments with 1,173 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, -121585.06, -9835.34 and -626976.59, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 4172987.50, 378052.96, -11195.58 and 3272815.94, -1584199.75, -5895.70 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 222.3919 sec
    For closed curve with 549 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0300 sec
    For closed curve with 400 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0210 sec
    Found 2 segments with 951 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, 118244.33, -9835.34 and -736996.89, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 4172987.50, 138224.05, -11195.58 and 3382835.99, -1584199.75, -6568.98 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 231.5341 sec
    For closed curve with 468 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0260 sec
    For closed curve with 301 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0230 sec
    Found 2 segments with 771 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, 358073.17, -9835.34 and -847016.91, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 4172987.50, -101605.92, -11195.58 and 3492856.52, -1584199.75, -6307.42 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 240.7321 sec
    For closed curve with 286 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0150 sec
    For closed curve with 176 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0100 sec
    Found 2 segments with 464 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, 597903.03, -9835.34 and -957037.40, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 4172987.50, -341436.08, -11195.58 and 3602877.16, -1584199.75, -6368.13 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 249.8012 sec
    For closed curve with 320 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0250 sec
    For closed curve with 59 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0040 sec
    Found 2 segments with 381 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, 837732.43, -9835.34 and -1067057.69, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 4172987.50, -581264.31, -11195.59 and 3712896.93, -1584199.75, -6452.21 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 258.8242 sec
    For closed curve with 265 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0250 sec
    For closed curve with 56 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0040 sec
    Found 2 segments with 323 total points and 0 corner points
    Information: Curve with endpoints -1227193.25, 1077561.26, -9835.34 and -1177077.71, 1186806.38, -9430.63 could not be closed.
    Information: Curve with endpoints 4172987.50, -821094.26, -11195.59 and 3822917.63, -1584199.39, -8504.14 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 2 determined in 267.8519 sec
    For closed curve with 146 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0090 sec
    For closed curve with 37 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0040 sec
    Found 2 segments with 185 total points and 0 corner points
    Information: Curve with endpoints 3932937.42, -1584199.75, -8770.85 and 4172987.50, -1060922.90, -11195.59 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 1 determined in 276.7701 sec
    For closed curve with 63 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0060 sec
    Found 1 segments with 64 total points and 0 corner points
    Information: Curve with endpoints 4042957.76, -1584199.75, -8785.16 and 4172987.50, -1300752.45, -11195.59 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 1 determined in 285.6004 sec
    For closed curve with 57 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0040 sec
    Found 1 segments with 58 total points and 0 corner points
    Information: Curve with endpoints 4152978.16, -1584199.63, -10232.42 and 4172987.50, -1540581.96, -11195.59 could not be closed.
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 1 determined in 294.3764 sec
    For closed curve with 25 unique boundary points, found no corner points on mesh for 4 hiZ-corner points in 0.0030 sec
    Found 1 segments with 26 total points and 0 corner points
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 0 determined in 303.0579 sec
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 0 determined in 311.8143 sec
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 0 determined in 320.5133 sec
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 0 determined in 320.5153 sec
    After projecting boundary curve onto mesh, the number of closed-curves found = 0 & not-closed = 0 determined in 320.5183 sec
    Found 1,552 points in the main curve which is not closed and 34,810 points in other curves in 320.5473 sec
Time after find_boundary_points = 320.7223 sec
    WARNING: Face 497246 at 2399629,1186291.5,-9387.94921875 with 3 crossings with item = [[751, 374130, 499562, 2], [752, 499562, 499736, 2], [753, 374130, 499562, 2]] was deleted.
Its center is marked in green.
    Information on face: i = 751 pts[i] = 1903297.16877627,1186338.73816105,-9391.86162946712, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 2.  The points are are marked in green, red and yellow
    Information on face: i = 752 pts[i] = 1903511.69435398,1186806.375,-9430.626953125, ji = 1490098,1186806,-9430.627 jo = 2853986,1186806,-9430.627 s = 2.  The points are are marked in green, red and yellow
    Information on face: i = 753 pts[i] = 2013238.37249135,1186214.31251741,-9381.54721463595, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 2.  The points are are marked in green, red and yellow
    WARNING: Face 497246 at 2399629,1186291.5,-9387.94921875 with 3 crossings with item = [[751, 374130, 499562, 1], [752, 499562, 499736, 1], [753, 374130, 499562, 1]] was deleted.
Its center is marked in green.
    Information on face: i = 751 pts[i] = 1903297.16877627,1186338.73816105,-9391.86162946712, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 1.  The points are are marked in green, red and yellow
    Information on face: i = 752 pts[i] = 1903511.69435398,1186806.375,-9430.626953125, ji = 1490098,1186806,-9430.627 jo = 2853986,1186806,-9430.627 s = 1.  The points are are marked in green, red and yellow
    Information on face: i = 753 pts[i] = 2013238.37249135,1186214.31251741,-9381.54721463595, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 1.  The points are are marked in green, red and yellow
    Number of main boundary points =  1
    Processed 1,552 boundary points to create data for 2,011 replacement faces and leave 1,507 naked_faces to be deleted = 0.5980 sec
    WARNING: Face 497246 at 2399629,1186291.5,-9387.94921875 with 3 crossings with item = [[2261, 374130, 499562, 2], [2262, 499562, 499736, 2], [2263, 374130, 499562, 2]] was deleted.
Its center is marked in green.
    Information on face: i = 2261 pts[i] = 1793312.06954644,1186463.21348332,-9402.18016246813, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 2.  The points are are marked in green, red and yellow
    Information on face: i = 2262 pts[i] = 1793469.49281989,1186806.375,-9430.626953125, ji = 1490098,1186806,-9430.627 jo = 2853986,1186806,-9430.627 s = 2.  The points are are marked in green, red and yellow
    Information on face: i = 2263 pts[i] = 2123223.27882841,1186089.83741345,-9371.22869973168, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 2.  The points are are marked in green, red and yellow
    WARNING: Face 497246 at 2399629,1186291.5,-9387.94921875 with 3 crossings with item = [[2261, 374130, 499562, 1], [2262, 499562, 499736, 1], [2263, 374130, 499562, 1]] was deleted.
Its center is marked in green.
    Information on face: i = 2261 pts[i] = 1793312.06954644,1186463.21348332,-9402.18016246813, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 1.  The points are are marked in green, red and yellow
    Information on face: i = 2262 pts[i] = 1793469.49281989,1186806.375,-9430.626953125, ji = 1490098,1186806,-9430.627 jo = 2853986,1186806,-9430.627 s = 1.  The points are are marked in green, red and yellow
    Information on face: i = 2263 pts[i] = 2123223.27882841,1186089.83741345,-9371.22869973168, ji = 2854802,1185262,-9302.594 jo = 1490098,1186806,-9430.627 s = 1.  The points are are marked in green, red and yellow

// Rolf

Can you split this mesh using lines in the same location as the curves with Rhino?
To work on this error I probably need the mesh and rectangles. Is the .3dm small enough to PM me with it? Or can you send me a link to the .3dm on Google drive or similar?

The messages in the log file are typical until the complaints about 3 face crossings. I have fixed dozens of these types of errors to get the code to work. Obviously there is more code I need to add in order to catch this case. I have fixed many that Rhino missed but there are still a few more. I would really like to get your test case to work on.

One thing to check is that there needs to be dozens of mesh faces in every square or the mesh cannot be properly split apart. If you look at the mesh inside each box, are there plenty of mesh faces in every box?

The mesh has not gone, it is still on the Start Mesh layer. But what has not shown up is the split mesh. The dots are color coded points that show the location of the faces with 3 mesh crossings. Turn the Start Mesh and Corners layers back on to see exactly what the mesh looks like at these points. Is there something different at these locations?

Regards,
Terry.

I sent you a link.

// Rolf

I don’t think I can be as quick as @Terry_Chappell, but it would be great to get your test case, too. This would help us improve Rhino, @RIL.

@piac, I sent you the same mesh.

@DanielPiker may also be interested in this case because the Kangaroo Remesher component fails to make this mesh isotropic, which actually should be the first step in dealing with this mesh. But cutting nasty meshes is an art in itself, which makes our job more interesting…

// Rolf

Agreed! :slight_smile:

@nathanletwory,

I have split Rolf’s mesh many times in the vertical direction but I have not been able to put the texture back on the pieces.

For another mesh like my SA mesh, I get the source material using:

#Get Rhino object for start mesh.
mobj = doc.Objects.Find(mesh)
#Try to get texture material for start mesh.
source_mat = mobj.Attributes.MaterialIndex

which returned:

source_mat = 1

The Materials tab for this mesh looks like:


and then I apply it to the split mesh using:

# Get Rhino object for new mesh.
obj = doc.Objects.Find(mesh)
# Apply source texture material to new mesh.
obj.Attributes.MaterialIndex = source_mat
obj.Attributes.MaterialSource = ObjectMaterialSource.MaterialFromObject
obj.CommitChanges()

and the textures are displayed.

But on Rolf’s mesh I get
source_mat = -1
which indicates no texture material present. When I look under Materials tab I see:


which does not look like what is on my SA mesh.

This post started off with a discussion about this mesh having a Decal. At one point I was able to see the Decal for Rolf’s mesh but not now even if I reopen the file. Maybe I stumbled across how to access it one time and have not been able to do it again.

In any case, how can I get the Decal on Rolf’s original mesh on the split mesh pieces I am making?

Regards,
Terry.

It is still a bit unclear to me whether the object now uses a decal or a material.

If decals then remember those are separate from materials. I guess those could be copied to.

Same really for materials and the mappings. I’m assuming an uv-mapping on the original mesh, then I’d (in the GUI):

  • create a copy of the mesh
  • split the original mesh
  • select split parts
  • match mappings: select the mesh copy

Anyway, regarding the materials table, I’d personally not use it. You may have noticed it works in a funky way. Add one material in the material editor, check by code the count of doc.Materials. It is 0. Create 10 objects, assign the one material to all of them. Check doc.Materials. Now you have count 10.

You should use the RenderMaterials table on the document instead. Get the RenderMaterial you need, then with SimulateMaterial() you get the Material from it which you can add to the doc.Materials table. The index you get from that you’ll use to assign to your mesh parts.