Home Toolbox functions Sample projects Tutorials Downloads |
|
Reference for maple version: Appendix B in Multibody Mechanics and Visualization by Harry Dankowicz, published by Springer Verlag UK, 2004.
DefineObjects[A,Type,options]
DefineObjects[{A1,Type1,options1}, ..., {An,Typen,optionsn}]
A,A1, ..., An: names of defined observers
Type,Type1, ...,Typen: types of Mambo objects
options,options1, ...,optionsn: optional arguments specifying object properties
The function DefineObjects associates a MAMBO object (sphere, cylinder, or block) with an already defined observer. Any number of objects may be associated with a given observer.
The function DefineObjects results in permanent changes to the global variable GlobalObjectDefinitions.
The Type argument takes one of the three values "Sphere", "Cylinder", or "Block".
The optional arguments passed to DefineObjects allow the user to specify internal geometric properties of the Mambo objects, such as color and dimension, and the orientation and position of the object relative to the parent observer:
Restart; DeclareObservers[A,B]; DeclarePoints[A,B,C]; DeclareTriads[a,b,c]; DefineObservers[{A,A,a},{B,B,b}]; DefinePoints[{A,B,a,0,1,2},{B,C,c,r-s,0,1}]; DefineTriads[{a,b,theta,1},{a,c,{s-Pi/2,1},{Pi/2,2}}]; DefineNeighbors[A,B]; DefineObjects[ {A,"Sphere","radius"->1,"orient"->MakeRotations[theta,1],"color"->"red"}, {B,"Cylinder","point"->B,"orient"->c,"length"->2*p1}, {A,"Block","xlength"->v,"ylength"->2*v,"zlength"->.5*v,"point"->C}]; GeometryOutput["main"->A]
MODULE A { Sphere { Orient {1.,0.,0.,0.,cos(theta),-sin(theta),0.,sin(theta),cos(theta)} Radius 1. Color {1.,0.,0.} } Block { Point {1.,1.-(r-s)*cos(s),2.-(r-s)*sin(s)} Xlength v Ylength 2.*v Zlength 0.5*v } BODY B { Point {0.,1.,2.} Orient {1.,0.,0.,0.,cos(theta),-sin(theta),0.,sin(theta),cos(theta)} Cylinder { Point {0,0,0} Orient {0.,0.,1.,-(cos(s)*cos(theta))-sin(s)*sin(theta),cos(theta)*sin(s)-cos(s)*sin(theta),0.,-(cos(theta)*sin(s))+cos(s)*sin(theta),-(cos(s)*cos(theta))-sin(s)*sin(theta),0.} Length 2.*p1 } } }
DeclareTriads, DeclareObservers,
DeclarePoints, DefineObservers,
DefinePoints, DefineTriads,
DefineNeighbors
|
©2004-2017 Harry Dankowicz Mechanical Science and Engineering University of Illinois at Urbana-Champaign | Home Toolbox functions Sample projects Tutorials Downloads |