command line on pc to 2.3 on mac
Hi Jon,
First, thanks for Breve. It's just what I need for my work. However, I am not a real computer expert so please bear with me.
I have been using the command line version of Breve on a PC and I have just received my new iBook (yea). I have downloaded the latest version and have tried to run my simulation. I know there is some changes and I am getting an error that says 'Error in File "Shape.TZ" at line 76' etc...
Can you give me a quick fix or at least some hints at what I need to do. Thanks and my apologies if this is blatantly obvious.
An simplified example of my code is below.
Cheers,
Darren
p.s. The smiley faces should be 8's and brackets (not sure how to change). Thanks again.
@include "PhysicalControl.tz"
@include "Joint.tz"
@include "MultiBody.tz"
@include "Shape.tz"
@include "Stationary.tz"
@include "Mobile.tz"
@include "Link.tz"
Controller Foot.
PhysicalControl : Foot {
+ variables:
FootThing (object).
+ to init:
floorShape (object).
floor (object).
floorShape = (new Shape init-with-cube size (30, 3, 30)).
floor = new Stationary.
floor register with-shape floorShape at-location (0, 0, 0).
floor set-color to (1.0, 1.0, 1.0).
FootThing = new FootForm.
FootThing show-bounding-box.
FootThing show-axis.
self point-camera at (-2.2, 1, 1.2) from (-31, 10, 21).
self set-background-color to (.4, .6, .9).
self enable-lighting.
self move-light to (-20, 20, 0).
self enable-smooth-drawing.
}
MultiBody : FootForm {
+ variables:
FxShape, FShape, RShape (object).
joint1, joint2 (object).
parts (list).
- to join1 parent part0 (object) with-child part1 (object):
joint1 = new myRevoluteJoint.
joint1 link parent part0 to-child part1
with-parent-point (-2.5, 1.5, -10) with-child-point (0, 0, 0)
with-normal (0, 0, 0).
joint1 set-joint-limits min (-0.15) max (0.0).
joint1 set-strength-limit to 400.
- to join2 parent part1 (object) with-child part2 (object):
joint2 = new myRevoluteJoint.
joint2 link parent part1 to-child part2
with-parent-point (3, 3.2, 8) with-child-point (-0.65, 0, -6.48)
with-normal (-1, 0, 1).
joint2 set-strength-limit to 10.
+ to init:
FShape = new myCustomShape.
FxShape = new Shape.
FxShape init-with-cube size (20, -3, 20).
RShape = new Shape.
RShape init-with-sphere radius (3.2).
#RShape get-point-on-shape on-vector (-1, 0, 0).
#RShape get-point-on-shape on-vector (1, 0, 0).
parts = 3 new Links.
parts{0} set shape FxShape.
parts{1} set shape FShape.
parts{2} set shape RShape.
parts{2} point vertex (1, -1, 1) at (0, 0, 0).
self register with-link parts{0}.
parts{0} set-color to (1, 1, 1).
parts{1} set-color to (0.4, 0, 0.6).
parts{2} set-color to (1.0, 0.2, 0).
self join1 parent parts{0} with-child parts{1}.
self join2 parent parts{1} with-child parts{2}.
}
CustomShape : myCustomShape {
+ variables:
vertices (5 vectors).
+ to init:
vertices[0] = (-5, 0, 0).
vertices[1] = (-5, 2.3, 0).
vertices[2] = (5, 0 , 0).
vertices[3] = (5, 1.6, 0).
vertices[4] = (-1.6, 4.1, 9.4).
self add-face with-vertex-list { vertices[0], vertices[1], vertices[3], vertices[2]}.
self add-face with-vertex-list { vertices[0], vertices[1], vertices[4]}.
self add-face with-vertex-list { vertices[0], vertices[2], vertices[4]}.
self add-face with-vertex-list { vertices[1], vertices[3], vertices[4]}.
self add-face with-vertex-list { vertices[2], vertices[3], vertices[4]}.
self finish-shape with-density 1.1.
}
RevoluteJoint : myRevoluteJoint {
+ to iterate:
self set-joint-velocity to sin((controller get-time) / 8) / 8.
}

command line on pc to 2.3 on mac
to get rid of the smilies, just click edit, and then check the box 'disable smilies in post' beneath your text 8)
command line on pc to 2.3 on mac
Hi,
the full error reads:
The problem is that at line 68 of your code, you are creating a cube of size (20, -3, 20) -- the Y-coordinate is negative. It would be pretty odd if this was working okay on Windows. Perhaps it got accidentally switched in the move? In any case, set that to (20, 3, 20) and it should work.
- jon
command line on pc to 2.3 on mac
Thanks Jon,
The code worked fine on the PC and I copied and emailed it to my new Mac, so I am not sure what happened.
Thanks for your help,
Darren
command line on pc to 2.3 on mac
Hi Jon,
Just in case this of any use to you I checked
the command line version and the negative
value was there and the simulation ran fine.
Hope this is of some use.
Thanks again for Breve.
Darren
command line on pc to 2.3 on mac
That's pretty bizarre! Thanks for the report -- I'll see if I can't figure out what the problem is.
- jon