Skip to content

Commit

Permalink
flatten the return to list of CSG
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Mar 7, 2023
1 parent b0f654f commit 64b8674
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion robotBase.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,20 @@ shortsensorPlate,
shortsensorStandOff

]
return parts

void flatten(ArrayList<CSG> flat,List<Object> incoming) {
for(Object o:incoming) {
if(List.class.isInstance(o)) {
flatten(flat,o)
}
if(CSG.class.isInstance(o)) {
flat.add(o)
}
}
}
def flat=[]
flatten(flat,parts)
return flat

def toProject =[bracket,wheelAsmb,tire,plate]
def toProjectF =[bracket,bracketm,wheelAsmb,wheelAsmbl,tire,plate,tirel]
Expand Down

0 comments on commit 64b8674

Please sign in to comment.