You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/examples/gyroscopic_effects.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ In this example, we demonstrate how a rotating body creates a reaction torque wh
7
7
The system consists of a pendulum suspended in a spherical joint, a joint without any rotational constraints. The tip of the pendulum is a cylinder that is rotating around a revolute joint in its center. When the pendulum swings, the rotation axis of the rotating tip is changed, this causes the entire pendulum to rotate around the axis through the pendulum rod.
Copy file name to clipboardExpand all lines: docs/src/examples/spherical_pendulum.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3

4
4
5
-
This example models a spherical pendulum. The pivot point is modeled using a [`Spherical`](@ref) joint, the pendulum rod is modeled using a [`FixedTranslation`](@ref)and the mass is modeled using a [`Body`](@ref). In this example, we choose the joint to be the root (joints are often better root objects than bodies).
5
+
This example models a spherical pendulum. The pivot point is modeled using a [`Spherical`](@ref) joint, this lets the pendulum rotate in three directions. The pendulum rod is modeled using a [`FixedTranslation`](@ref), a component without inertial properties, and the mass of the tip is modeled using a [`Body`](@ref). To model a rod with inertial properties, see, e.g., [`BodyShape`](@ref) or [`BodyCylinder`](@ref), In this example, we choose the joint to be the root (joints are often better root objects than bodies).
Copy file name to clipboardExpand all lines: src/components.jl
+239-5Lines changed: 239 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -357,6 +357,8 @@ The `BodyShape` component is similar to a [`Body`](@ref), but it has two frames
357
357
- `r`: Vector from `frame_a` to `frame_b` resolved in `frame_a`
358
358
- All `kwargs` are passed to the internal `Body` component.
359
359
- `shapefile`: A path::String to a CAD model that can be imported by MeshIO for 3D rendering. If none is provided, a cylinder shape is rendered.
360
+
361
+
See also [`BodyCylinder`](@ref) and [`BodyBox`](@ref) for body components with predefined shapes and automatically computed inertial properties based on geometry and density.
360
362
"""
361
363
@componentfunctionBodyShape(; name, m =1, r = [0, 0, 0], r_cm =0.5*r, r_0 =0, radius =0.08, color=purple, shapefile="", kwargs...)
iszero(r_shape) ||error("non-zero r_shape not supported")
679
+
width_dir =collect(width_dir)
680
+
length_dir =collect(length_dir)
681
+
end
682
+
683
+
@parametersbegin
684
+
# r[1:3]=r, [ # MTKs symbolic language is too weak to handle this as a symbolic parameter in from_nxy
685
+
# description = "Vector from frame_a to frame_b resolved in frame_a",
686
+
# ]
687
+
# r_shape[1:3]=zeros(3), [
688
+
# description = "Vector from frame_a to box origin, resolved in frame_a",
689
+
# ]
690
+
# length = _norm(r - r_shape), [
691
+
# description = "Length of box",
692
+
# ]
693
+
# length_dir[1:3] = _norm(r - r_shape), [
694
+
# description = "Vector in length direction of box, resolved in frame_a",
695
+
# ]
696
+
697
+
# width_dir[1:3] = width_dir0, [
698
+
# description = "Vector in width direction of box, resolved in frame_a",
699
+
# ]
700
+
701
+
# NOTE: these are workarounds to allow rendering of this component. Unfortunately, MTK/JSCompiler cannot handle parameter arrays well enough to let these be actual parameters
702
+
render_r[1:3]=r, [description="For internal use only"]
703
+
render_r_shape[1:3]=r_shape, [description="For internal use only"]
704
+
render_length = length, [description="For internal use only"]
705
+
render_length_dir[1:3] = length_dir, [description="For internal use only"]
706
+
render_width_dir[1:3] = width_dir, [description="For internal use only"]
0 commit comments