Skip to content

Commit

Permalink
only add cords when tail length is longet than the flangs
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Jun 13, 2023
1 parent 67e5948 commit 2649627
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions servo.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import org.apache.commons.io.IOUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import eu.mihosoft.vrl.v3d.CSG
import eu.mihosoft.vrl.v3d.Cube
import eu.mihosoft.vrl.v3d.Cylinder
import eu.mihosoft.vrl.v3d.parametrics.*;
CSG servoFactory(
double servoThinDimentionThickness,
Expand Down Expand Up @@ -69,7 +72,7 @@ CSG servoFactory(
CSG cord = new Cube(
9,// x dimention
6,// y dimention
tailLength.getMM()// Z dimention
tailLength.getMM()>0?tailLength.getMM():1// Z dimention
)
.noCenter()
.toCSG()
Expand All @@ -78,7 +81,10 @@ CSG servoFactory(

.movey(shaftToShortSideDistance-3)
.movez(-tailLength.getMM())
CSG builtServo = CSG.unionAll([flange,body,cord])
CSG builtServo = CSG.unionAll([flange,body])
if(tailLength.getMM()>flangeThickness) {
builtServo=builtServo.union(cord)
}
if(servoConfig!=null){
if(servoConfig.get("numberOfHolesPerFlange")!=null){
LengthParameter boltLength = new LengthParameter("Servo Bolt Length",bottomOfFlangeToTopOfBody,[500,0.01])
Expand Down

0 comments on commit 2649627

Please sign in to comment.