Skip to content
Laird Popkin edited this page Aug 29, 2014 · 14 revisions

Assembler standard wrapper

To integrate STL component into the Assembler, it must provide a "wrapper" module that takes the standard measurements and coordinates and uses them to scale and position the part. Then it's a simple extension to the Assembler to add calls to the wrapper.

Note that the parameters of the "wrapper" module are identical between the parametric and static components. The difference is in how the wrapper invokes the component.

OpenSCAD supports STL and OBJ files.

Guides for making STLs that are easy to integrate into the Assembler

The Assembler can load and scale any STL or OBJ file, but some things make it easier.

  1. Scale should me in mm.
  2. The STL should have the relevant control point at the [0,0,0] coordinate, with the part oriented with Z up and Y axis forward. That is, as if the arm is straight along the Y axis, so elbow, wrist, knuckle, and finger joints should be in a straight line. This makes it easiest to translate and scale the parts to the actual arm position for previewing.
  3. Rotation and offset for printing, so that it's flat on the plane of Z=0. For example, if a part should be rotated upside down and raised 7mm. This allows Handomatic to render the part for printing and to combine parts into printable plates.
  • Gauntlet: origin in center of wrist joint
  • Palm: origin in center of wrist joint
  • Thumb and Finger Proximal: origin in center of knuckle
  • Thumb and Finger Distal: origin in center of joint between proximal and distal

The key measurements for the parts should be documented if possible. These are:

  • Gauntlet: width at outside of wrist end of gauntlet (to fit gauntlet)
  • Palm: width at inside of wrist (to fit gauntlet), and outside of knuckles (to match other hand)
  • Proximals: distance from knuckle to joint
  • Distals: distance from joint to tip

Other parts

If there are additional parts, such as snap pins, they should be provided as separate STL files so that they can be positioned for previewing and for printing. For those parts, please place the origin at the center bottom of the part, and document:

  • How many to print
  • Where they fit in relation to the other parts

These parts will be scaled and positioned with the

Future

When we add this capability to Handomatic, joint holes should be removed from parts, so that they can be replaced in software after scaling and translation.

Parameters

The assembler will call the module and pass in the standard parameters:

  • assemble: False means that the part should be rendered for printing, True means that the part should be positioned in space between the control points (e.g. wrist and knuckles) so that the user can see the part previewed in place as a part of a complete assembly.

  • wrist: [x, y, z] coordinates of wrist, to make translation to that point easy.

  • knuckle: [x, y, z] coordinates of knuckles, to make translation to that point easy.

  • measurements: array of all measurements, as defined by Assembler.scad. That is:

    [[prostheticHand, Left1, Left2, Left3, Left4, Left5,Left6, Left7, Left8, Left9, Left10, LeftFlexion, LeftExtension],

    `[1-prostheticHand, Right1, Right2, Right3, Right4, Right5,Right6, Right7, Right8, Right9, Right10, RightFlexion, RightExtension]];`
    

measurements[0][0] is 0 if the prosthetic is for the left hand, and 1 if the prosthetic is for the right hand. measurements[1][0] is the other hand. This allows for constructing expressions such as measurements[measurements[1][0]][5] to refer to measurement 5 from the non-prosthetic hand.

The arm is in a line, with elbow, wrist, knuckle and fingertips in a straight line on the positive Y axis. Z is up.

  • label is a text label to superimpose on the part for identifying the part for later tracking and reprinting.
  • font uses Write.scad font names to personalize the parts. The default is letters.dxf.

Responsibilities of the wrapper module

Scale the STL file to suit the measurements. For example, take the wrist to knuckle measurement of the non-prosthetic hand and make the palm for the prosthetic hand that long.

Translate the part so that the rear control point (e.g. wrist for palm, knuckle for finger) is at [0,0,0] for printing, or at the wrist control point for displaying the assembled parts.

Superimpose the label onto the STL, to 'serialize' each print.

Sample wrapper

Sample wrapper module that takes standard parameters, includes the parametric design, and calls the parametric design. Note that this can be a module defined in the part's file.

use <write/Write.scad>

// Comment this out to use in assembly //CyborgLeftPalm(assemble=true);

This is the module invoked by Assembly.scad.

module CyborgLeftPalm(' assemble=false, wrist=[0,0,0], knuckle=[0, 51.85, 0], measurements, ' label="http://eNABLE.us/NCC1701/1", font="Letters.dxf") { if (assemble==false) // render for printing CyborgLeftPalmInner(assemble=false, wrist=wrist, knuckle=knuckle, measurements=measurements, label=label, font=font); if (assemble==true) // render for preview within complete assembly translate(wrist) // palm [0,0,0] is wrist hinge CyborgLeftPalmInner(assemble=false, wrist=wrist, knuckle=knuckle, measurements=measurements, label=label, font=font); }

The inner module scales and imports the STL.

module CyborgLeftPalmInner(wrist, knuckle, measurements, label, font) { CBLPwristOffset = [40,-25,1.5]; // translate by this to move wrist to [0,0,0] targetLen = knuckle[1]-wrist[1]; stlLen = 54; // length measured in STL (i.e. to scale from) scale = targetLen/stlLen; echo("<<cyborg beast palm, version 1.15, scale: ", scale, ">>"); %translate([0,0,50]) rotate([90,0,-90]) write(str(floor(scale*100+.5),"%"), center=true, h=30, font=font);

`echo("Cyborg Beast Palm, scale ",scale*100,"% translate ",CBLPwristOffset);`
`scale([1,scale,scale])` // Note: scale X (width) independently from Y/Z so gauntlet and fingers fit.
	`translate(CBLPwristOffset) union() {`
		`import("../Cyborg_Beast/STL Files/STL Files_ Marc Petrykowski_4-16-2014/Cyborg Left Palm 1.15.stl");`
		`import("Cyborg Left Palm 1.15.stl");`
		`echo("Label ", label);`
		`color("blue") translate([0,stlLen-10.5,0]) translate(-1*CBLPwristOffset) resize([42,1,8])`
			`rotate([90,0,0]) write(label, center=true, h=8, font=font);`
		`}`
`}`
Clone this wiki locally