Skip to content

fix(server): onshape composite parts keep their colors on import - #230

Merged
AadiJo merged 1 commit into
mainfrom
onshape-import-colors
Nov 9, 2026
Merged

AadiJo merged 1 commit into
mainfrom
onshape-import-colors

Conversation

@AadiJo

@AadiJo AadiJo commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Composite parts imported from Onshape assemblies could lose their colors. NEO Vortex motors, which Onshape shows dark gray, rendered almost white. Onshape's 3MF export writes a fixed near-white (232,232,232) on composite faces whose color should come from a constituent body. The importer copied those colors as-is.

Composite parts now skip the 3MF archive and use the existing source-geometry fallback (per-part or Part Studio batch glTF with outputFaceAppearances=true). Onshape's glTF endpoint returns the displayed colors for composites. Every other part keeps its 3MF geometry and per-face colors, so multi-color parts are unchanged.

The bulk geometry profile changes to onshape-3mf-coarse-meters-z-up-opacity-composite-source-v4, so existing snapshots rebuild on the next sync. That sync does one full re-import. After that, unchanged syncs use one request again. Each import adds about one request per Part Studio that contains a composite.

Verification

  • New test: a composite part present in the 3MF is fetched from source geometry. It fails before this change and passes after it.
  • All 182 Onshape server tests pass, and the server typecheck and lint are clean.
  • Checked against a real robot assembly with the live API:
    • The 3MF gave the NEO Vortex motor 93.5% of its area at 232,232,232.
    • Onshape's tessellatedfaces data and shaded view show 55,55,55.
    • The part glTF returns 55,55,55 on 95.9% of its area, and a composite chain keeps its 127/205 face split.
    • Of 12 parts whose 3MF colors differ from their BOM color, 9 solids and the chain already matched Onshape's display. The solids keep their 3MF colors. The encoder composite could not be checked, because its housing hides it in every view.

Limitations

Onshape's glTF stores sRGB values in baseColorFactor. The viewer already corrects this when a material's color equals the part's BOM color, as it does for other fallback parts. A composite with no face at its BOM color would still render lighter than in Onshape.

Reviewed with sol-loop: 1 round with gpt-6.1-sol. Sol verdict: approved

@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cadsense Skipped Skipped Nov 9, 2026 1:18am UTC

@AadiJo
AadiJo merged commit a26b912 into main Nov 9, 2026
8 checks passed
@AadiJo
AadiJo deleted the onshape-import-colors branch November 26, 2026 19:51

This branch was previously deployed

1 inactive deployment
Preview — 448c3cdb Deployed Nov 9, 2026 by vercel[bot]
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