Page MenuHome

Geometry Node: Stretch profiles around turns in Curve to Mesh Node.
Needs ReviewPublic

Authored by Shan Huang (yemount) on Sep 27 2022, 9:14 AM.

Details

Summary

Stretch profile curves around turns in curve to mesh. This is done by

  1. compute the desired stretch amount to keep the connecting edges parallel to the curve segment.
  2. compute a matrix to scale the profile by the amount around its main position, and ONLY in the direction of the curvature.

This addresses T80979.

Diff Detail

Repository
rB Blender
Branch
fix-bevel (branched from master)
Build Status
Buildable 24754
Build 24754: arc lint + arc unit

Event Timeline

Shan Huang (yemount) requested review of this revision.Sep 27 2022, 9:14 AM
Shan Huang (yemount) created this revision.

Capture profile stretching transformation as a matrix.

source/blender/blenkernel/intern/curve_to_mesh_convert.cc
204

Diagram about the math:

216

This is a bit more matrix multiplication than I'd like... but at least we only need to compute it one per turn, and it's quite neat for readability imo to capture the transform in a matrix.

Alternatively I can project the pre-stretch point onto the axes defined by (tangent, curvature, up), scale the curvature vector, and sum everything back up. (Roughly like this: https://developer.blender.org/D16076?vs=on&id=56170)

Let me know if that is more preferred.

Hi Shan, just tested diff 57863, it is working with "flat" curve however not really with a 3D "maze" where some profile/bevel rotation appears on some corners.