Skip to content

Instantly share code, notes, and snippets.

@musesum
Last active July 16, 2016 16:15
Show Gist options
  • Save musesum/67ab7b814defcf3c114602e341668f9f to your computer and use it in GitHub Desktop.
Save musesum/67ab7b814defcf3c114602e341668f9f to your computer and use it in GitHub Desktop.
Test Tr3 Definition of robot
// script representing a crude robot
limb {arm {hand {finger[5]}} leg {foot}}
robot:{left right}:limb
robot^^ <-> .* // connect every node to its children
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm:(0...3000)}
robot^^{space} // recursively attach space to every node
// resulting output via c++11 backend
√ {limb {arm {hand {finger {0 1 2 3 4}}}
leg {foot}}
robot <->(robot.left robot.right) {
left <->(robot.left.arm robot.left.leg) {
arm <->(robot.left.arm.hand) {
hand <->(robot.left.arm.hand.finger) {
finger <->(
robot.left.arm.hand.finger.0
robot.left.arm.hand.finger.1
robot.left.arm.hand.finger.2
robot.left.arm.hand.finger.3
robot.left.arm.hand.finger.4) {
0 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
1 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
2 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
3 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
4 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
leg <->(robot.left.leg.foot) {
foot {space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
right <->(robot.right.arm robot.right.leg) {
arm <->(robot.right.arm.hand) {
hand <->(robot.right.arm.hand.finger) {
finger <->(
robot.right.arm.hand.finger.0
robot.right.arm.hand.finger.1
robot.right.arm.hand.finger.2
robot.right.arm.hand.finger.3
robot.right.arm.hand.finger.4) {
0 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
1 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
2 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
3 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
4 { space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
leg <->(robot.right.leg.foot) {
foot {space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
space {pos:(x y z):(0...1) ang:(a b c):(%360) mm :(0...3000)}}
@musesum
Copy link
Author

musesum commented Jul 16, 2016

pasted graphic 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment