Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Capsules3D archetype. #7574

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Add Capsules3D archetype. #7574

wants to merge 3 commits into from

Conversation

kpreid
Copy link
Collaborator

@kpreid kpreid commented Oct 2, 2024

What

Part of #1361.

Adds the archetype Capsules3D, component Length, and a matching visualizer.

Capsules are defined by their length and radius, and then transformed in the usual fashion to set their orientation. There is also a constructor for joining a pair of endpoints.

image

Missing parts that should make it into this PR before it leaves draft:

  • Needs an example image — I assume I don't have the permissions to upload one.
  • Needs C++ or Python _ext and snippets — I will add these before the PR leaves draft.

Further work not included in this PR, that will add complications:

  • There is no wireframe mesh support (expressed as having no FillMode component). This is because it was recommended that I use re_math’s capsules, but re_math has no support for generating wireframes. In the long run, we will want to support tapered capsules and cylinders and a new or substantially revised mesh generator to handle these cases will be needed anyway.
  • The support for setting the length of a capsule is a horrible kludge which is hard on the mesh cache — each length:radius ratio is cached separately. The idea I have for fixing this is adding “bone” support — the ability for selected vertices to be displaced by an externally controlled offset. This allows taking a single capsule mesh and stretching it without distorting the endcaps. (Tapered capsules will require multiple meshes to account for the angle at which the cone meets the endcap, but those can be fairly well approximated by a finite set of meshes.)

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@kpreid kpreid added 📺 re_viewer affects re_viewer itself include in changelog labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant