Preface
ArtiSynth Modeling Guide
John Lloyd and Antonio Sánchez
Last update: August, 2022
Contents
Preface
How to read this guide
1
ArtiSynth Overview
1.1
System structure
1.1.1
Model components
1.1.2
The RootModel
1.1.3
Component path names
1.1.4
Model advancement
1.1.5
MechModel
1.2
Physics simulation
1.3
Basic packages
1.3.1
maspack
1.3.2
artisynth.core
1.3.3
artisynth.demos
1.4
Properties
1.4.1
Querying and setting property values
1.4.2
Property handles and paths
1.4.3
Composite and inheritable properties
1.5
Creating an application model
1.5.1
Implementing the build() method
1.5.2
Making models visible to ArtiSynth
1.5.3
Loading and running a model
2
Supporting classes
2.1
Vectors and matrices
2.2
Rotations and transformations
2.3
Points and Vectors
2.4
Spatial vectors and inertias
2.5
Meshes
2.5.1
Mesh creation
2.5.2
Setting normals, colors, and textures
2.5.3
Automatic creation of normals and hard edges
2.5.4
Vertex and feature coloring
2.5.5
Reading and writing mesh files
2.5.6
Reading and writing normal and texture information
2.5.7
Constructive solid geometry
2.6
Reading source relative files
2.7
Reading and caching remote files
3
Mechanical Models I
3.1
Springs and particles
3.1.1
Axial springs and materials
3.1.2
Example: a simple particle-spring model
3.1.3
Dynamic, parametric, and attached components
3.1.4
Custom axial materials
3.1.5
Damping parameters
3.2
Rigid bodies
3.2.1
Frame markers
3.2.2
Example: a simple rigid body-spring model
3.2.3
Creating rigid bodies
3.2.4
Pose and velocity
3.2.5
Inertia and the surface mesh
3.2.6
Damping parameters
3.2.7
Rendering rigid bodies
3.2.8
Multiple meshes
3.2.9
Example: a composite rigid body
3.3
Joints and connectors
3.3.1
Joints and coordinate frames
3.3.2
Joint coordinates, constraints, and errors
3.3.3
Creating Joints
3.3.4
Working with coordinates
3.3.5
Example: a simple hinge joint
3.3.6
Constraint forces
3.3.7
Compliance and regularization
3.3.8
Example: an overconstrained linkage
3.3.9
Rendering joints
3.4
Joint components
3.4.1
Hinge Joint
3.4.2
Slider Joint
3.4.3
Cylindrical Joint
3.4.4
Slotted Hinge Joint
3.4.5
Universal Joint
3.4.6
Skewed Universal Joint
3.4.7
Gimbal Joint
3.4.8
Spherical Joint
3.4.9
Planar Joint
3.4.10
Planar Translation Joint
3.4.11
Solid Joint
3.4.12
Planar Connector
3.4.13
Segmented Planar Connector
3.4.14
Legacy Joints
3.5
Frame springs
3.5.1
Frame spring coordinate frames
3.5.2
Frame materials
3.5.3
Creating frame springs
3.5.4
Example: two bodies connected by a frame spring
3.6
Attachments
3.6.1
Point attachments
3.6.2
Example: model with particle attachments
3.6.3
Frame attachments
3.6.4
Example: model with frame attachments
4
Mechanical Models II
4.1
Simulation control properties
4.1.1
maxStepSize
4.1.2
integrator
4.1.3
stabilization
4.2
Units
4.2.1
Scaling units
4.3
Render properties
4.3.1
Render property taxonomy
4.3.2
Setting render properties
4.3.3
Texture mapping
4.4
Point-to-point muscles
4.4.1
Muscle materials
ConstantAxialMuscle
LinearAxialMuscle
BlemkerAxialMuscle
PeckAxialMuscle
MasoudMillardLAM
4.4.2
Example: Muscle attached to a rigid body
4.5
Distance Grids and Components
4.6
Transforming geometry
4.6.1
Nonlinear transformations
4.6.2
Example: the FemModelDeformer class
4.6.3
Implementation and behavior
4.6.4
Use in model registration
4.7
General component arrangements
4.7.1
Container components
4.7.2
Example: a net formed from balls and springs
4.7.3
Adding containers to other models
4.8
Custom Joints
4.8.1
Joint constraints
4.8.2
Unilateral constraint engagement
4.8.3
Implementing a custom joint
4.8.4
Implementing a custom coupling
4.8.5
Example: a simple custom joint
5
Simulation Control
5.1
Control Panels
5.1.1
General principles
5.1.2
Example: Creating a simple control panel
5.2
Custom properties
5.2.1
Adding properties to a component
5.2.2
Example: a visibility property
5.3
Controllers and monitors
5.3.1
Implementation
5.3.2
Example: A controller to move a point
5.4
Probes
5.4.1
Numeric probe structure
5.4.2
Creating probes in code
5.4.3
Example: probes connected to SimpleMuscle
5.4.4
Data file format
5.4.5
Adding probe data in-line
5.4.6
Numeric monitor probes
5.4.7
Numeric control probes
5.5
Application-Defined Menu Items
6
Finite Element Models
6.1
Overview
6.1.1
FemModel3d
6.1.2
Component Structure
6.1.2.1
Nodes
6.1.2.2
Elements
6.1.2.3
Shell elements
6.1.2.4
Meshes
6.1.3
Materials
6.1.4
Boundary conditions
6.2
FEM model creation
6.2.1
Factory methods
6.2.2
Loading external FEM meshes
6.2.3
Generating from surfaces
6.2.4
Building elements in code
6.2.5
Example: a simple beam model
6.3
FEM Geometry
6.3.1
Surface meshes
6.3.2
Embedding geometry within an FEM
6.3.3
Example: a beam with an embedded sphere
6.4
Connecting FEM models to other components
6.4.1
Connecting nodes to rigid bodies or particles
6.4.2
Example: connecting a beam to a block
6.4.3
Connecting nodes directly to elements
6.4.4
Example: connecting two FEMs together
6.4.5
Finding which nodes to attach
6.4.6
Example: two bodies connected by an FEM “spring”
6.4.7
Nodal-based attachments
6.4.8
Example: element vs. nodal-based attachments
6.5
FEM markers
6.5.1
Example: attaching an FEM beam to a muscle
6.6
Frame attachments
6.6.1
Example: attaching frames to an FEM beam
6.6.2
Adding joints to FEM models
6.6.3
Example: two FEM beams connected by a joint
6.7
Incompressibility
6.7.1
Volume regions and locking
6.7.2
Hard incompressibility
6.7.3
Soft incompressibility
6.7.4
Incompressibility and linear materials
6.7.5
Using incompressibility in practice
6.8
Varying and augmenting material behaviors
6.8.1
Example: FEM sheet with a stiff spine
6.9
Muscle activated FEM models
6.9.1
FemMuscleModel
6.9.1.1
Bundles
6.9.1.2
Exciters
6.9.2
Fibre-based muscles
6.9.3
Material-based muscles
6.9.4
Example: comparison with two beam examples
6.10
Fields
6.10.1
Grid fields
6.10.2
FEM fields
6.10.2.1
Nodal fields
6.10.2.2
Element fields
6.10.2.3
Sub-element fields
6.10.3
Mesh fields
6.10.3.1
Vertex fields
6.10.3.2
Face fields
6.10.4
Fields for VectorNd, MatrixNd and Vector3d
6.10.5
Binding material properties
6.10.6
Example: FEM with variable stiffness
6.10.7
Example: specifying FEM muscle directions
6.11
Rendering and Visualizations
6.11.1
Example: stress and strain plotting
7
Contact and Collision
7.1
Enabling collisions
7.1.1
Collisions between specific bodies
7.1.2
Default collisions between groups
7.1.3
Example: collision with a plane
7.1.4
Collisions for FEM models
7.1.5
Example: FEM models and rigid bodies
7.2
Collision behaviors and collidability
7.2.1
Collision behaviors
7.2.2
Collidability
7.3
Collision meshes and compound collidables
7.3.1
Example: redefining a rigid body collision mesh
7.3.2
Compound collidables and self-collision
7.3.3
Example: FEM model with self-collision
7.3.4
Collidable bodies
7.3.5
Nested MechModels
7.4
Implementation
7.4.1
Contact methods
7.4.1.1
Contour region
7.4.1.2
Vertex penetration
7.4.1.3
Setting the contact method
7.4.2
Collider types
7.4.2.1
Collision meshes and signed distance grids
7.5
Contact rendering
7.5.1
Example: rendering normals and contours
7.5.2
Example: rendering a color map
7.5.3
Example: rendering contact pressures
7.6
Overconstrained contact
7.6.1
Constraint reduction
7.7
Contact regularization
7.7.1
Compliant contact
7.7.2
Contact force behaviors
7.7.2.1
Computing forces based on pressure
7.7.3
Elastic foundation contact
7.7.4
Example: elastic foundation contact of a ball in a bowl
7.7.5
Example: binding EFC properties to fields
7.8
Monitoring collisions
7.8.1
Collision responses
7.8.2
Available information
7.8.3
Example: monitoring contact forces
7.9
Tips and limitations
7.9.1
Contact jitter
7.9.2
Passing through objects
7.9.3
Stray vertices
7.9.4
Coulomb friction and stability
8
Muscle Wrapping and Via Points
8.1
Via Points
8.1.1
Example: a muscle with via points
8.2
Obstacle Wrapping
8.2.1
Example: wrapping around a cylinder
8.3
General Surfaces and Distance Grids
8.3.1
Example: wrapping around a bone
8.4
Initializing the Wrap Path
8.4.1
Example: wrapping around a torus
8.5
Alternate Wrapping Surfaces
8.5.1
Example: wrapping for a finger joint
8.6
Tuning the Wrapping Behavior
9
Skinning
9.1
Implementation
9.2
Creating a skin mesh
9.2.1
Example: skinning over rigid bodies
9.3
Computing weights
9.3.1
Setting weights explicitly
9.4
Markers and point attachments
9.4.1
Markers
9.4.2
Point attachments
9.4.3
Example: skinning rigid bodies and FEM models
9.4.4
Mesh-based markers and attachments
9.5
Resolution and Limitations
9.6
Collisions
9.6.1
Example: collision with a cylinder
9.7
Application to muscle wrapping
9.7.1
Example: wrapping for a finger joint
10
DICOM Images
10.1
The DICOM file format
10.2
The DICOM classes
10.2.1
DicomElement
10.2.2
DicomHeader
10.2.3
DicomPixelBuffer
10.2.4
DicomSlice
10.2.5
DicomImage
10.3
Loading a
DicomImage
10.3.1
Time-dependent images
10.3.2
Image formats
10.4
The
DicomViewer
10.5
DICOM example
A
Mathematical Review
A.1
Rotation transforms
A.2
Rigid transforms
A.3
Affine transforms
A.4
Rotational velocity
A.5
Spatial velocities and forces
A.6
Spatial inertia