liveBook · Manning

Geometric primitive

As explained in Robotics for Programmers

A geometric primitive is a simple shape defined by a small set of parameters such as lengths, radii, or angles.

A 3D modeling primitive is a geometrically simple shape represented by a minimal parameter set. Its definition describes shape only, separately from pose: position and orientation. A cylinder, for example, needs radius and height; a cuboid needs width, length, and height. This compact representation is useful when a robot link or object is simple enough to describe directly rather than as a detailed surface model. section 6.1.5

Figure 6.12 Simple geometric shapes, such as circles, rectangles, and cylinders, are mathematically defined by a minimal set of parameters, such as length, radius, and angle.
CH06 Fxx bihlmaier primitive shapes

Simple shapes expose the core idea: a small number of lengths, radii, and angles uniquely defines each primitive. section 6.1.5

Common parameterizations include:

  • A line uses length; a circle or sphere uses radius. section 6.1.5
  • A rectangle uses width and length, while a cuboid adds height. section 6.1.5
  • A cylinder uses radius and height. section 6.1.5
  • A triangle can use three side lengths, two sides and their included angle, or two angles and the included side. section 6.1.5

Parameterized formulas make primitives operational rather than merely descriptive. They can render a shape and its outline, test whether a point lies inside it, and test whether two shapes intersect. For a circle centered at the origin, the radius defines both its equation and its boundary points: iterating an angle t through a full turn yields x = r cos(t) and y = r sin(t). A point is inside or on that circle when its distance from the origin is no greater than r. section 6.1.5

Robot-link geometry in URDF

Use primitives for simple robot links and meshes where shape detail requires them. A URDF link can contain box geometry for visualization, with dimensions supplied directly in the geometry element. Keep visualization and collision shapes separate when appropriate: each can use a different shape suited to its purpose. Position the link geometry relative to its link frame with an origin, then connect links through joints to form the robot’s kinematic tree. section 6.1.6 section 6.1.6

Listing 6.3 ​
<robot name="snackbot"> #1
  <link name="base_link"> #2
    <visual name="base_link_visual1"> #3
      <origin xyz="0.05 0.05 0.0078" rpy="0 0 0"/> #4
      <geometry> #5
        <box size="0.1 0.1 0.0156"/>
      </geometry>
      <material name="blue"> #6
        <color rgba="0 0 0.8 1"/>
      </material>
    </visual>
    <visual name="base_link_visual2"> #7
      <origin xyz="0.05 0.05 0.1421" rpy="0 0 0"/>
      <geometry>
        <box size="0.05 0.05 0.253"/>
      </geometry>
      <material name="cyan">
        <color rgba="0 0.8 0.8 1"/>
      </material>
    </visual>
  </link>

  <joint name="joint1" type="revolute"> #8
    <parent link="base_link"/> #9
    <child link="link1"/>
    <origin xyz="0.050 0.050 0.268" rpy="0 0 0"/> #10
    <axis xyz="0 0 1"/> #11
    <limit lower="-1.57" upper="1.57" effort="10" velocity="10"/> #12
  </joint>

  ...

  <link name="link2">
    <visual name="link2_visual">
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <mesh filename="package://rfp_snackbot/models/snackbot/link_2_manual.stl"/>
      </geometry>
      <material name="yellow">
        <color rgba="0.8 0.8 0 1"/>
      </material>
    </visual>
  </link>

  ...
</robot>

The URDF fragment shows a base link assembled from box primitives, each with explicit dimensions and a local origin. section 6.1.6

Primitives trade geometric detail for directness. Constructive solid geometry can combine them through union, difference, and intersection to create more complex solids. When an object needs a detailed surface, use a mesh: connected polygons, typically triangles defined by vertices, edges, and faces. Other representations serve different sensing or modeling needs: voxel grids discretize volume, while point clouds record visible sampled surface points without explicit connectivity or volume. section 6.1.5 section 6.1.5

How Robotics for Programmers covers it

How deep it goes
Defines common parameter sets and circle formulas, then applies primitives in URDF without deriving detailed mesh or voxel algorithms.
Examples
Uses circles, cylinders, cuboids, and a SnackBot URDF base link built from boxes.
What it assumes
Teaches primitive parameterization from basic geometric shapes while assuming enough URDF context to model links and joints.
What you can do after
Apply it via URDF by choosing primitive dimensions and placing simple link geometry relative to link frames.
How it connects
Connects geometric primitives to pose, constructive solid geometry, meshes, voxels, point clouds, URDF, links, joints, and collision checking.

Also explained in

Compare how 2 books explain geometric primitive →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Robotics for Programmers. The section links point to the parts of the book it draws on.