cad-editor/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Hakan Seven 74a685d0e8 fix(viewport): UTM auto-fit + mesh world_offset
Two world_offset bugs in viewport rendering.

(1) Solid3D / Region / Body meshes were tessellated straight out of
the ACIS SAT data in WCS, while the wire / hatch / face3d pipelines
all run in `(WCS - world_offset)` local space. At UTM scale the
result was triangles drifting millions of units off-camera every
frame. `offset_mesh_lod_set` post-processes the freshly built
`MeshLodSet`, subtracting `world_offset` from every vertex and
recomputing `world_aabb` so the LOD / cull math agrees with the
shared camera space. Applied at the three `tessellate_volume`
call sites — load, `add_entity`, and `populate_meshes_from_document`.

(2) Paper-space content viewports rendered blank on UTM drawings.
The DWG / DXF saved `view_target = (0, 0, 0)` while the model sat
around `world_offset`; the CPU projection in `viewport_content_wires`
already had a "saved view doesn't overlap content cluster →
auto-fit to (world_offset ± local_extent_max)" fallback, but the
GPU path read `vp.view_target` literally and culled every entity
against the empty WCS rect. `camera_for_viewport` now applies the
same overlap test + auto-fit, and `model_wires_for_viewport`
derives its frustum AABB / wpp from the resulting camera so both
the camera and the cull agree on which area to show.

Folding `view_center` directly into `effective_target_wcs` matches
the CPU path's `display_center_x = view_target + view_center`,
removing the prior `+ view_right * view_center.x` shift that would
double-count once auto-fit had overwritten the target.
2026-05-28 20:51:16 +03:00
..
app feat(viewport): draggable Model-tile dividers 2026-05-28 18:42:39 +03:00
command fix(dyn-input): correct Y coordinate, label by prompt type — #27 2026-05-27 13:41:54 +03:00
entities fix(hatch): stop drawing ghost line between boundary polylines 2026-05-26 18:16:40 +03:00
io chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
modules refactor(ui): remove the viewport navigation bar 2026-05-27 17:49:23 +03:00
scene fix(viewport): UTM auto-fit + mesh world_offset 2026-05-28 20:51:16 +03:00
shaders fix(viewport): blit UV crop for off-canvas viewports 2026-05-28 12:15:00 +03:00
snap chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
ui fix(overlay): hide system cursor over viewport, drop CAD over divider 2026-05-28 19:52:34 +03:00
lib.rs feat: in-app update notice — checks GitHub releases on startup 2026-05-16 19:55:57 +03:00
linetypes.rs chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
main.rs chore(release): drop flatpak, add macOS .dmg, hide Windows console 2026-05-20 21:13:02 +03:00
patterns.rs chore: rename H7CAD to Open CAD Studio 2026-05-23 17:16:15 +03:00
update_check.rs chore(deps): bump to latest stable versions 2026-05-23 22:21:30 +03:00