Skip to content

Add Meshes.jl package extension for geometry translation (fixes #208) - #275

Open
rainerrodrigues wants to merge 1 commit into
rdeits:masterfrom
rainerrodrigues:support-meshes
Open

Add Meshes.jl package extension for geometry translation (fixes #208)#275
rainerrodrigues wants to merge 1 commit into
rdeits:masterfrom
rainerrodrigues:support-meshes

Conversation

@rainerrodrigues

Copy link
Copy Markdown

Description

This PR addresses issue #208 by adding native support for Meshes.jl via Julia's Package Extension system.

Changes Made

  • Added Meshes as a weak dependency in Project.toml.
  • Created ext/MeshesExt.jl to act as a translation layer.
  • Overloaded MeshCat.setobject! to accept Meshes.Geometry types.
  • Implemented translation methods for Meshes.Box and Meshes.Sphere to convert them into GeometryBasics equivalents.
  • Added a helper function to safely strip Unitful units from the Meshes coordinate points before passing them to the visualizer.

Example Usage:

using MeshCat, Meshes
vis = Visualizer()
setobject!(vis, Meshes.Box(Meshes.Point(0.0, 0.0, 0.0), Meshes.Point(1.0, 2.0, 1.0)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant