Skip to content

Expose glTF tessellation options - #1462

Draft
Joe-Spencer wants to merge 1 commit into
mainfrom
codex/gltf-tessellation-options
Draft

Joe-Spencer wants to merge 1 commit into
mainfrom
codex/gltf-tessellation-options

Conversation

@Joe-Spencer

Copy link
Copy Markdown
Contributor

Allow glTF export requests to choose tessellation detail, accurate tessellation, and surface-curvature handling. The new optional tessellation object supports five detail presets and a visualization helper. Omitted settings retain the existing request serialization and behavior; partial objects default to High detail with both accuracy flags enabled.

Includes OpenAPI, TypeScript, Python, arbitrary-data, and builder support. Runtime integration is tracked in https://github.com/KittyCAD/format/pull/929.

Validation: all 33 modeling-command library tests and both Python binding-name regression tests pass with all features. OpenAPI generation and validation, the Python/TypeScript/arbitrary feature check, formatting, and diff checks pass.

@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.29412% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@39f0882). Learn more about missing BASE report.

Files with missing lines Patch % Lines
modeling-cmds/src/format/gltf.rs 95.29% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1462   +/-   ##
=======================================
  Coverage        ?   38.78%           
=======================================
  Files           ?       33           
  Lines           ?     1828           
  Branches        ?        0           
=======================================
  Hits            ?      709           
  Misses          ?     1119           
  Partials        ?        0           
Flag Coverage Δ
unittests 38.78% <95.29%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +102 to +116
pub struct TessellationOptions {
/// Detail level of the generated triangles. Defaults to high.
#[builder(default)]
pub level_of_detail: TessellationLevelOfDetail,

/// Enable accurate tessellation for analysis. Defaults to true.
/// Disable to use visualization tessellation with a smaller footprint.
#[builder(default = true)]
pub accurate: bool,

/// Account for surface curvature during accurate tessellation. Defaults to true.
/// Only applies when accurate tessellation is enabled.
#[builder(default = true)]
pub accurate_surface_curvatures: bool,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy with the internal API but this one needs more work.

I suggest we split out tessellation options from glTF so they can be shared across other formats.

The accurate_surface_curvatures parameter is too concerned with the implementation, it should be removed entirely.

I suggest we replace the accurate parameter with something more intentional:

pub mod tessellation {
    /// Level of detail
    pub struct Lod {
        ...
    }

    // I can't think of a better name right now...
    pub enum Kind {
        // Low accuracy, non-watertight.
        Visual,
        // High accuracy, watertight.
        Analysis,
    }

    pub struct Options {
        pub lod: Lod,
        pub kind: Kind,
    }
}

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.

2 participants