Hi @TrademarkCreative .
I think when you work with meshes in Fusion360, they are automatically split into triangles because they are triangle meshes, except for the T-splines.
If the data does not contain any curved surfaces, as in this case, the tangentiallyConnectedFaces property may be used.
I found the theme interesting, so I made a script that changes the color of the surfaces on the same plane to the same color when the body is selected.
# Fusion360API Python script
import adsk.core, adsk.fusion, traceback
import random
def run(context):
ui = adsk.core.UserInterface.cast(None)
try:
app :adsk.fusion.Application = adsk.core.Application.get()
ui = app.userInterface
# Select BrepBody
msg :str = 'Select BRepBody'
selFiltter :str = 'Bodies'
sel :adsk.core.Selection = selectEnt(msg ,selFiltter)
if not sel: return
body :adsk.fusion.BRepBody = sel.entity
# Get faceGroup
faceGroup = groupByFlattenSurfaces(body)
# Change Color
vp :adsk.core.Viewport = app.activeViewport
for faces in faceGroup:
appearance = getUniqueColor()
for face in faces:
face.appearance = appearance
vp.refresh()
adsk.doEvents()
ui.messageBox('Done')
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def generate_random_color():
return [random.randint(0, 255) for _ in range(3)]
def getUniqueColor() -> adsk.core.Appearance:
app :adsk.fusion.Application = adsk.core.Application.get()
des :adsk.fusion.Design = app.activeProduct
base :adsk.core.Appearance = des.appearances[0]
while True:
rgb = generate_random_color()
name = '#{:X}{:X}{:X}'.format(*rgb)
if not des.appearances.itemByName(name):
appearance :adsk.core.Appearance = des.appearances.addByCopy(base, name)
colorProp = appearance.appearanceProperties.itemById('surface_albedo')
colorProp.value = adsk.core.Color.create(rgb[0], rgb[1], rgb[2], 255)
return appearance
def groupByFlattenSurfaces(
body :adsk.fusion.BRepBody) -> List:
adsk.fusion.BRepFace.registerGroup = False
flattenGroups = []
for face in body.faces:
if face.registerGroup:
continue
lst =[face]
lst.extend([surf for surf in face.tangentiallyConnectedFaces])
for surf in lst:
if surf.registerGroup:
print('Hit')
surf.registerGroup = True
flattenGroups.append(lst)
return flattenGroups
def selectEnt(
msg :str,
filtterStr :str) -> adsk.core.Selection :
try:
app = adsk.core.Application.get()
ui = app.userInterface
sel = ui.selectEntity(msg, filtterStr)
return sel
except:
return None

I haven't tested it in detail, but I think it probably handles it correctly.
The colors are applied randomly, so there is a possibility that some colors are very close to each other.
If you use "the Four Color Theorem", you may only need four colors, but I don't understand it.