github HakanSeven12/OpenCADStudio v0.4.3

latest releases: v2026.36, v0.9.8, v0.9.7...
3 months ago

Unified viewport architecture

  • Model and paper layouts now share a single GPU shader widget: Scene::active_viewports yields a Vec<ViewportInstance> (one per tiled Model pane or floating paper viewport), and the MultiPipeline renders each into its own scissor pass.
  • Model space gains a tiled-pane layout: split the active tile via ▤/▥ buttons or VPORTS 2H|2V|4|SINGLE, drag the inner dividers to resize, and drag a divider past the ViewCube minimum to collapse the pane into its longest-contact neighbour. The tile layout (rect + per-pane camera) round-trips through the DXF/DWG VPort table via *OCS_Tile_<i> entries.
  • Paper layout drops the old PaperViewportPane + PaperViewportPipeline newtype. The PaperCanvas 2-D widget draws the sheet, paper-space entities and viewport borders; every content viewport (active and inactive) renders through the unified shader on top, with a transparent shader clear + alpha-blended blit so the paper sheet shows through outside drawn geometry.

Paper viewport rendering

  • Each content viewport now runs its own frustum + LOD cull (view_aabb + wpp derived from the viewport's stored camera + on-paper pixel height), so 100k-entity drawings no longer re-tessellate the whole model through every floating viewport every frame. Per-viewport hatch / wipeout / mesh upload follows the same pattern.
  • UTM-style drawings whose view_target = (0, 0, 0) no longer render blank — camera_for_viewport runs the same overlap-with-content-cluster test the CPU projection path already had and auto-fits when the saved view points at empty WCS.
  • Off-canvas viewports composite correctly: the per-viewport MSAA is sized to the on-canvas intersection and the camera projection is cropped via crop_view_proj to map only the visible sub-rect to NDC, so deep paper zoom no longer panics in Device::create_texture past the 8192-pixel limit and partially off-screen viewports no longer drift toward the canvas corner.
  • Inactive paper viewports were drifting against the CPU projection in PaperCanvas once the rect ran off-canvas; the CPU projection of model content is now removed (the unified GPU path is the single source of truth) and paper_canvas_hatches / paper_canvas_wipeouts filter to paper-layout-block entities only so model-block hatches don't get a second copy on the sheet.

Color adaptation

  • adapt_to_bg now reaches every entity type: wires (already), hatches, ACIS meshes (Solid3D / Region / Body), 3DFACE filled triangles. New Scene::recolor_meshes rewrites cached mesh colours on BACKGROUND change + layout switch so ACIS solids track the live background without re-tessellating.
  • BlockCache stores raw sub-entity colours and applies adapt_to_bg at Batches::finalize time with the per-render bg_color. A single cached block defn now serves model and paper renders simultaneously with the right adaptation per render call — no rebuild needed on BACKGROUND or layout switch.
  • model_wires_for_viewport adapts model content shown in paper viewports to the paper background (what's actually visible behind the transparent shader), not the model bg.

Mesh / world_offset / UTM precision

  • ACIS solids were tessellated straight from the SAT data in WCS while every other path runs in (WCS - world_offset) — at UTM scale this floated meshes millions of units off camera. The new offset_mesh_lod_set shifts each MeshLodSet's verts + world_aabb into the shared local f32 space at every tessellation call site.
  • Model-tile cameras + view_targets round-trip through the DXF/DWG VPort table with world_offset added back, so saved tiled layouts re-open at the right model coordinates.

Cosmetics + input

  • Cursor hidden over the viewport (Interaction::Hidden) so the CAD crosshair is the only cursor; the OS resize arrow takes over on Model-tile dividers, and the CAD crosshair is suppressed there to avoid double cursors.
  • Divider hover hit-test + drag pipeline. Border between Model tiles drawn as a 2-px line.
  • Render-mode picker, ViewCube hit-area and the active-viewport border follow the active tile in tiled Model layouts and the active viewport in paper layouts.
  • Premultiplied-alpha blit fixes the double-darkening of anti-aliased line edges against the now-transparent shader background.

Full Changelog: v0.4.2...v0.4.3

Don't miss a new OpenCADStudio release

NewReleases is sending notifications on new releases.