COMPAS
  • Home
  • Docs
  • Extensions
  • Examples
  • Contribute
  • 1.0.0
  1. docs
  2. API Reference
  3. compas
  4. robots
  5. ToolModel
  6. ToolModel.add_link

ToolModel.add_link

ToolModel.add_link(name, visual_meshes=None, visual_color=None, collision_meshes=None, **kwargs)

Adds a link to the robot model.

Provides an easy way to programmatically add a link to the robot model.

Parameters
  • name (str) – The name of the link

  • visual_meshes (list of compas.datastructures.Mesh, optional) – The link’s visual mesh.

  • visual_color (list of 3 float, optional) – The rgb color of the mesh. Defaults to (0.8, 0.8, 0.8)

  • collision_meshes (list of compas.datastructures.Mesh, optional) – The link’s collision mesh.

Returns

Link – The created Link

Raises

ValueError – If the link name is already used in the chain.

Examples

>>> sphere = Sphere((0, 0, 0), 1)
>>> mesh = Mesh.from_shape(sphere)
>>> robot = RobotModel('robot')
>>> link = robot.add_link('link0', visual_mesh=mesh)
  • Introduction
  • Installation
  • Getting started
  • Tutorial
  • API Reference
    • compas
      • datastructures
      • files
      • geometry
      • numerical
      • plugins
      • robots
      • rpc
      • topology
      • utilities
    • compas_rhino
    • compas_blender
    • compas_ghpython
    • compas_plotters
  • Extension points
  • Developer Guide
  • Changelog
  • Releases
  • License
  • Citing
  • ToolModel.add_link
Previous
ToolModel.add_joint
Next
ToolModel.compute_transformations

COMPAS

A computational framework for collaboration and research in Architecture, Engineering, Fabrication, and Construction.

Newsletter

Copyright © 2017-2020 compas-dev