From 7d7e452ce53318cb15d55cd0756ee2a401e86438 Mon Sep 17 00:00:00 2001 From: Kevin Harrington Date: Mon, 19 Jun 2023 18:58:10 -0400 Subject: [PATCH] remove force bed arrange --- MarcosCad.groovy | 182 +++++++++++++++++++++++------------------------ 1 file changed, 91 insertions(+), 91 deletions(-) diff --git a/MarcosCad.groovy b/MarcosCad.groovy index c93c14db..24cfa76f 100644 --- a/MarcosCad.groovy +++ b/MarcosCad.groovy @@ -130,7 +130,7 @@ CSG spline = gears.get(0) CSG resinPrintServoMount=cutcore.difference(spline) resinPrintServoMount.setColor(Color.DARKGREY) -class cadGenMarcos implements ICadGenerator,IgenerateBed{ +class cadGenMarcos implements ICadGenerator{ String url = "https://github.com/OperationSmallKat/Marcos.git" CSG resinPrintServoMount HashMap numbers @@ -154,96 +154,96 @@ class cadGenMarcos implements ICadGenerator,IgenerateBed{ Transform move = com.neuronrobotics.bowlerstudio.physics.TransformFactory.nrToCSG(step) return incoming.transformed(move) } - /** - * This function should generate the bed or beds or parts to be used in manufacturing If parts are - * to be ganged up to make print beds then this should happen here - * - * @param base the base to generate - * @return simulatable CAD objects - */ - ArrayList arrangeBed(MobileBase base){ - println "Generating Marcos Print Bed" - ArrayList resin = [] - ArrayList one = [] - ArrayList two = [] - ArrayList three = [] - for(CSG bit :cache) { - def bitGetStorageGetValue = bit.getStorage().getValue("bedType") - if(bitGetStorageGetValue.present) { - bit=bit.prepForManufacturing() - String name=bit.getName() - File source=new File(ScriptingEngine.getRepositoryCloneDirectory(url).getAbsolutePath()+"/print_bed_location_"+name+".json") - if(source.exists()) { - //println "Loading location from "+source.getAbsolutePath() - Type TT_mapStringString = new TypeToken>() { - }.getType(); - - ArrayList l = gson.fromJson(source.text, TT_mapStringString); - if(l!=null&& l.size()>0) { - TransformNR location=l.get(0) - if(location!=null) { - Transform csfMove = TransformFactory.nrToCSG(location) - bit=bit.transformed(csfMove) - } - } - } - def bitGetStorageGetValueGetToString = bitGetStorageGetValue.get().toString() - if(bitGetStorageGetValueGetToString.contentEquals("resin")) { - resin.add(bit) - } - else if(bitGetStorageGetValueGetToString.contentEquals("ff-One")) { - one.add(bit) - } - else if(bitGetStorageGetValueGetToString.contentEquals("ff-Two")) { - two.add(bit) - } - else if(bitGetStorageGetValueGetToString.contentEquals("ff-Three")) { - three.add(bit) - }else { - println "unknown bed type! "+bitGetStorageGetValueGetToString - } - println "Adding part to Print bed "+bitGetStorageGetValueGetToString+" "+name - } - else - println "Rejecting "+bit.getName() - } - - CSG bedThree=toBed(three ,"FF-Bed-Three") - CSG bedTwo=toBed(two ,"FF-Bed-Two") - CSG bedOne=toBed(one ,"FF-Bed-One") - CSG resinBed=null - for(int i=0;i<4;i++) { - for (int j=0;j<4;j++) { - double x = i*(numbers.ServoHornDiameter) - double y = j*(numbers.ServoHornDiameter+1.0) - try { - int index = i*4+(j) - if(index arrangeBed(MobileBase base){ +// println "Generating Marcos Print Bed" +// ArrayList resin = [] +// ArrayList one = [] +// ArrayList two = [] +// ArrayList three = [] +// for(CSG bit :cache) { +// def bitGetStorageGetValue = bit.getStorage().getValue("bedType") +// if(bitGetStorageGetValue.present) { +// bit=bit.prepForManufacturing() +// String name=bit.getName() +// File source=new File(ScriptingEngine.getRepositoryCloneDirectory(url).getAbsolutePath()+"/print_bed_location_"+name+".json") +// if(source.exists()) { +// //println "Loading location from "+source.getAbsolutePath() +// Type TT_mapStringString = new TypeToken>() { +// }.getType(); +// +// ArrayList l = gson.fromJson(source.text, TT_mapStringString); +// if(l!=null&& l.size()>0) { +// TransformNR location=l.get(0) +// if(location!=null) { +// Transform csfMove = TransformFactory.nrToCSG(location) +// bit=bit.transformed(csfMove) +// } +// } +// } +// def bitGetStorageGetValueGetToString = bitGetStorageGetValue.get().toString() +// if(bitGetStorageGetValueGetToString.contentEquals("resin")) { +// resin.add(bit) +// } +// else if(bitGetStorageGetValueGetToString.contentEquals("ff-One")) { +// one.add(bit) +// } +// else if(bitGetStorageGetValueGetToString.contentEquals("ff-Two")) { +// two.add(bit) +// } +// else if(bitGetStorageGetValueGetToString.contentEquals("ff-Three")) { +// three.add(bit) +// }else { +// println "unknown bed type! "+bitGetStorageGetValueGetToString +// } +// println "Adding part to Print bed "+bitGetStorageGetValueGetToString+" "+name +// } +// else +// println "Rejecting "+bit.getName() +// } +// +// CSG bedThree=toBed(three ,"FF-Bed-Three") +// CSG bedTwo=toBed(two ,"FF-Bed-Two") +// CSG bedOne=toBed(one ,"FF-Bed-One") +// CSG resinBed=null +// for(int i=0;i<4;i++) { +// for (int j=0;j<4;j++) { +// double x = i*(numbers.ServoHornDiameter) +// double y = j*(numbers.ServoHornDiameter+1.0) +// try { +// int index = i*4+(j) +// if(index parts, String name) { CSG bedOne=null