Skip to content

Instantly share code, notes, and snippets.

@acamilo
acamilo / MoveLimb.groovy
Created June 5, 2019 16:26 — forked from madhephaestus/.gitignore
Move a limb attached to a MobileBase
import org.apache.commons.io.IOUtils;
import com.neuronrobotics.bowlerstudio.physics.*;
import com.neuronrobotics.bowlerstudio.threed.*;
def base;
//Check if the device already exists in the device Manager
if(args==null){
base=DeviceManager.getSpecificDevice( "MediumKat",{
return ScriptingEngine.gitScriptRun( "https://github.com/OperationSmallKat/SmallKat_V2.git",
"loadRobot.groovy",
[ "https://github.com/OperationSmallKat/greycat.git",
float moduleHeight = 30;
float LCDThickness = 6.3;
CSG cube = new Cube( 157.300,// X dimention
126.300,// Y dimention
moduleHeight// Z dimention
).toCSG().movez(moduleHeight/2)// this converts from the geometry to an object we can work with
@acamilo
acamilo / VitaminsExample.groovy
Created February 1, 2017 21:20 — forked from madhephaestus/VitaminsExample.groovy
An example using hardware vitamins.
import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;
import eu.mihosoft.vrl.v3d.parametrics.*;
// to add your own viatamins, fork https://github.com/madhephaestus/Hardware-Dimensions and make your modifications there.
class allViataminMaker implements IParameterChanged{
ArrayList <CSG> examples = null
ArrayList <CSG> getParts(){
if(examples!=null)
return examples
examples = new ArrayList<>()
import com.neuronrobotics.bowlerstudio.creature.ICadGenerator;
import com.neuronrobotics.bowlerstudio.creature.CreatureLab;
import org.apache.commons.io.IOUtils;
//Create the kinematics model from the xml file describing the D-H compliant parameters.
String xmlContent = ScriptingEngine.codeFromGistID("bcb4760a449190206170","CarlTheRobot.xml")[0];
println "Loading the robot"
MobileBase base=null;
if(DeviceManager.getSpecificDevice(MobileBase.class, "CarlTheWalkingRobot")==null){
BowlerStudio.speak("Connecting CarlTheWalkingRobot.");
base = new MobileBase(IOUtils.toInputStream(xmlContent, "UTF-8"));
double size =40;
CSG cube = new Cube( size,// X dimention
size,// Y dimention
size// Z dimention
).toCSG()
//create a sphere
CSG sphere = new Sphere(size/20*12.5).toCSG()
// perform a union
CSG cubePlusSphere = cube.difference(sphere);
import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;
import eu.mihosoft.vrl.v3d.parametrics.*;
int sphereRadius = 125;
int flapRadius = 65;
CSG body = new Sphere(sphereRadius,40,40)// Spheres radius
.toCSG()// convert to CSG to display
CSG cavity = new Sphere(sphereRadius-5,40,40)// Spheres radius
.toCSG()// convert to CSG to display
@acamilo
acamilo / shelfDividers.groovy
Last active August 18, 2016 14:21 — forked from madhephaestus/shelfDividers.groovy
A parametric shelf divider system
//Your code here
import eu.mihosoft.vrl.v3d.parametrics.*;
ArrayList<CSG> makeDividers(){
LengthParameter thickness = new LengthParameter("Material Thickness",6.2,[10,1])
LengthParameter foamThick = new LengthParameter("Foam Thickness",25,[40,1])
LengthParameter height = new LengthParameter("Divider Height",60,[200,1])
LengthParameter sheetX = new LengthParameter("sheetX",590,[914.4,1])// rows
LengthParameter sheetY = new LengthParameter("sheetY",590,[609.6,1])//columns
ArrayList<CSG> parts = new ArrayList<CSG>()
import eu.mihosoft.vrl.v3d.parametrics.*;
CSG makeCube(){
//Set up som parameters to use
LengthParameter xkey = new LengthParameter("X dimention",30,[120.0,1.0])
LengthParameter ykey = new LengthParameter("Y dimention",30,[130.0,2.0])
LengthParameter zkey = new LengthParameter("Z dimention",30,[140.0,3.0])
LengthParameter sphereSize = new LengthParameter("Sphere Size",30,[150.0,4.0])
//you can also create parametrics that are not used in creating primitives
LengthParameter offset = new LengthParameter("Sphere Offset Distance",15,[20,-5])
@acamilo
acamilo / javaCad.groovy
Last active June 3, 2016 01:30 — forked from madhephaestus/.gitignore
JavaCadExample
import eu.mihosoft.vrl.v3d.STL;
import eu.mihosoft.vrl.v3d.RoundedCube;
import com.neuronrobotics.bowlerstudio.vitamins.*;
import eu.mihosoft.vrl.v3d.parametrics.*;
float len = 68;
float width = 70;
float height = 42;
float thickness = 6.35;
float dia = 15;
@acamilo
acamilo / helloWorld.groovy
Created May 14, 2016 19:40 — forked from madhephaestus/.gitignore
BowlerStudio Hello World
//you print messages to the text output
println "Hello World From BowlerStudio Terminal!"
// or have it speak messages
BowlerKernel.speak("My copy")