@@ -468,6 +468,26 @@ cdef Model get_model(Node node, bint top):
468468 model = Model._vector(vertices, faces)
469469 if model is not None and node.get_bool(' repair' , False ):
470470 model = model.repair()
471+ elif not top and node.kind is ' transform' :
472+ transform_matrix = update_transform_matrix(node, IdentityTransform)
473+ model = Model._boolean(' union' , [get_model(child, False )._transform(transform_matrix) for child in node._children], 0 , 0 , 0 )
474+ elif node.kind is ' trim' or node.kind is ' slice' :
475+ normal = node.get_fvec(' normal' , 3 , null_)
476+ origin = node.get_fvec(' origin' , 3 , Zero3)
477+ if len (node._children) == 1 :
478+ model = get_model(node._children[0 ], False )
479+ else :
480+ model = Model._boolean(' union' , [get_model(child, False ) for child in node._children], 0 , 0 , 0 )
481+ if model is not None and normal.as_bool():
482+ model = model._trim(origin, normal,
483+ node.get_float(' smooth' , 0 ),
484+ node.get_float(' fillet' , 0 ),
485+ node.get_float(' chamfer' , 0 ))
486+ elif node.kind in (' union' , ' intersect' , ' difference' ):
487+ model = Model._boolean(node.kind, [get_model(child, False ) for child in node._children],
488+ node.get_float(' smooth' , 0 ),
489+ node.get_float(' fillet' , 0 ),
490+ node.get_float(' chamfer' , 0 ))
471491 elif node.kind is ' sdf' :
472492 maximum = node.get_fvec(' maximum' , 3 , node.get_fvec(' max' , 3 , One3))
473493 minimum = node.get_fvec(' minimum' , 3 , node.get_fvec(' min' , 3 , maximum.neg()))
@@ -483,23 +503,6 @@ cdef Model get_model(Node node, bint top):
483503 model = Model._sdf(None , model, minimum, maximum, resolution)
484504 elif node.kind is ' mix' :
485505 model = Model._mix([get_model(child, False ) for child in node._children], node.get_fvec(' weights' , 0 , true_))
486- elif not top and node.kind is ' transform' :
487- transform_matrix = update_transform_matrix(node, IdentityTransform)
488- model = Model._boolean(' union' , [get_model(child, False )._transform(transform_matrix) for child in node._children], 0 , 0 , 0 )
489- elif node.kind in (' union' , ' intersect' , ' difference' ):
490- model = Model._boolean(node.kind, [get_model(child, False ) for child in node._children],
491- node.get_float(' smooth' , 0 ),
492- node.get_float(' fillet' , 0 ),
493- node.get_float(' chamfer' , 0 ))
494- elif node.kind is ' trim' or node.kind is ' slice' :
495- normal = node.get_fvec(' normal' , 3 , null_)
496- origin = node.get_fvec(' origin' , 3 , Zero3)
497- model = Model._boolean(' union' , [get_model(child, False ) for child in node._children], 0 , 0 , 0 )
498- if model is not None and normal.as_bool():
499- model = model._trim(origin, normal,
500- node.get_float(' smooth' , 0 ),
501- node.get_float(' fillet' , 0 ),
502- node.get_float(' chamfer' , 0 ))
503506 elif (cls := get_plugin(' flitter.render.window.models' , node.kind)) is not None :
504507 model = cls .from_node(node)
505508 if model is not None :
0 commit comments