Commit Graph
154 Commits
Author SHA1 Message Date
dotCooCoo 49d4698c6a 3D: a twisted bevel's smoothed normals follow its curved pieces
With a twist, a band cuts each edge into pieces whose cut corners lie on
the art's curve, but the smoothed mesh normals and the 60 degree crease
test were worked out on straight chords between the edge's corners. On
a curved outline the normals then described quads other than the faces
the mesh holds. The corner rule is now one function, cut_corner, which
curved_band and smoothed_rows both use, so each piece's smoothed normal
comes from the quad that is built. Straight and uncut edges are as
before.

The test a_twisted_round_bevels_smoothed_normals_follow_its_curved_pieces
checks that each smoothed corner of a twisted, rounded bevel on a circle
is the mean of the normals of the two faces that meet there, with and
without perspective.
2026-11-22 03:56:16 -08:00
dotCooCoo c48b3e8c93 Merge main into feat/three-d-mesh-attributes 2026-11-21 22:34:22 -08:00
dotCooCoo b364b31523 3D: curved_band takes its two rings as one argument
curved_band took eight arguments once it gained the mesh's band data,
and an allow attribute silenced clippy's too_many_arguments lint. It now
takes the partner rings as one [a, b] array, and the allow attribute has
been removed.
2026-11-21 21:53:47 -08:00
dotCooCoo 6f0af81f91 3D: a twisted bevel's cut edges keep their smoothed normals
With a twist, each edge of a band is cut into pieces, and the mesh gave
those pieces their flat face normals, so a rounded or custom bevel with
a twist was exported faceted. The smoothed normals are now worked out
for each piece of each edge, from the same pieces the band is cut into,
and every piece takes its own.

The test a_twisted_rounded_bevel_keeps_its_normals_smoothed_on_every_piece_of_a_cut_edge
checks that where the pieces of two bevel bands meet, the two bands
give each piece one normal.
2026-11-21 21:49:44 -08:00
dotCooCoo 4b176782be 3D: caps, Rotate's plane and Inflate's faces take UVs in the object's bounds
Extrude & Bevel's caps, Rotate's plane and Inflate's front and back took
their texture coordinates in the bounds of each part's own rings, so a
part smaller than its object had its coordinates stretched to its own
extent and did not line up with the object's other parts. They now use
the bounds the solid is built with, which every part of one object
shares, as the Turn, Placing and Camera transforms already do.

The test the_parts_of_one_object_place_their_caps_and_planes_in_its_shared_bounds
builds a small part inside a larger object's bounds with each effect and
checks every front and back corner against the shared bounds.
2026-11-21 21:39:03 -08:00
dotCooCoo 4a6924669e 3D: meshes carry UVs, smooth bevel normals and a part index
Every mesh the 3D effects build now carries texture coordinates for
each corner and a part for each triangle (front, back, side, front
bevel, back bevel, end cap, cut side). Corners shared by two bands of
one bevel take the mean of the bands' normals unless the bevel turns
there by 60 degrees or more or a band lies flat toward the front or
back, and Inflate's puffed front and back keep the surface's own
normals. The vector facets do not change.

- Caps, Rotate's plane and Inflate's front and back map the art's
  bounds; walls and bevels run u along each contour and v from the
  front cap's edge to the back cap's; Revolve's side runs u around the
  sweep and v along the profile.
- OBJ, glTF and USD write every corner's texture coordinates, not only
  those of faces with mapped graphics.
- Mesh::join checks its index offsets, and joining or exporting a mesh
  whose lists do not match or that holds a value that is not a number
  is an error.

Docs: docs/three-d.md (3D meshes), docs/mcp.md, docs/effects-parity.md,
docs/target-app-parity.md.
2026-11-21 18:25:03 -08:00
dotCooCoo 0aafbdeb6d 3D: twisted bevel pieces meet the inset cap at sharp joins
A twist cut a beveled edge at points of the art's curve itself, while the
inset cap's edge eases its corners' miter offsets across the whole edge.
Where the art meets another edge at a sharp angle, the pieces next to the
cap drew a different curve from the cap's, leaving a gap of up to about
1.5 pt between them.

Each cut corner now takes the edge's corner offsets, eased across the
edge as the cap's edge eases them, and each piece follows the whole
edge's curve, so the pieces draw the cap's edge within the cap's
sampling tolerance, with and without perspective.

The tiny-circle test now also requires the solids to keep at least one
curve before it checks their control points.
2026-11-21 01:38:37 -08:00
dotCooCoo 1bff8f1071 3D: Expand Appearance keeps curves on Inflate faces, interior bevel edges and twist cuts
Extrude & Bevel and Inflate drew several edges along the art's curves as
straight segments with a corner at every sample point, so Object > Expand
Appearance gave them corner anchors:

- The edges between two bevel steps and between two wall slices had no
  outline. Every band now gets the outline of both its rings, and the two
  faces that share a ring draw the same curves.
- A twist cut a wall's edge at points on the chord between two samples.
  The cut corners now lie on the art's curve, and each piece follows its
  own part of the curve, so the wall meets the cap along the cap's curve.
- Inflate's flat back, its side walls, and the cells of its front and
  puffed back along the outline were polygons. They now follow the art's
  curves, the cells within the sampling tolerance. The search for the
  cells' edges along the outline stops after 4,194,304 edges per solid
  (VectorCraft's own limit); the rest stay straight.

Visibility, depth order and face counts are still worked out on the
sampled polygons. Tests in crates/three-d/src/solid/tests_curves.rs.
2026-11-21 00:54:19 -08:00
bflatastic aa853ad275 Merge main into #8741
# Conflicts:
#	docs/effects-parity.md
#	docs/three-d.md
2026-11-20 06:07:45 +07:00
dotCooCoo 3fb77f58bb Merge main into feat/3d-custom-bevels 2026-11-19 04:54:39 -08:00
dotCooCoo cb96dc123a Merge main into feat/3d-graphics-inflate 2026-11-19 04:53:50 -08:00
BFlat 3892841db0 Merge pull request #8511 from dotCooCoo/fix/export3d-revolve-side-graphics
3D: Export 3D Object writes the art mapped onto a Revolve's side
2026-11-19 15:00:20 +07:00
dotCooCoo db1442db8a Merge main into feat/3d-custom-bevels 2026-11-18 23:53:53 -08:00
dotCooCoo 52e959d4be 3D (Classic): Map Art keeps to the limits the art draws within
- When any solid's mapped art passes the shared limits, every solid in
  the effect draws without its mapped art, so Invisible Geometry hides
  all of them or none.
- A revolved group lists its surfaces with the members' shared curve
  sampling, and an extruded group lists none past the faces of one
  object.
- Commands refuse art on walls, bevels and Revolve's side whose curves,
  cut into straight pieces at the map's scale and placed about the
  surface's center, pass 400,000 points. Caps are not counted.
- Each contour's bounds test counts as a cut, in Map Art and in the side
  graphics.
- On a facet whose curved edge bows out of its cell, the art reaches the
  whole facet.
- A bevel as deep as the solid leaves no walls, and its bevels take the
  numbers after the caps.
- Surfaces past the face limit are refused as the side is.
- threeD.mapArt keeps a deleted symbol only while the request leaves
  `symbol` out.
2026-11-18 16:25:43 -08:00
dotCooCoo 877befe5a6 3D: Revolve's drawn faces and exported mesh share one side-corner helper
The canvas faces and the exported side mesh each worked out where a
side quad's four corners lie on the unrolled surface. Both now call
surface_corners, so the two keep the same corner order and formula.
2026-11-18 16:04:41 -08:00
dotCooCoo 8ea7d2155c Merge main into fix/export3d-revolve-side-graphics 2026-11-18 07:39:59 -08:00
dotCooCoo 86f821754f Merge main into feat/3d-graphics-inflate 2026-11-18 06:16:38 -08:00
dotCooCoo 19b5ca1869 Merge main into feat/3d-classic-map-art 2026-11-18 01:15:52 -08:00
dotCooCoo 935558d489 Merge main into feat/3d-graphics-inflate 2026-11-17 22:21:50 -08:00
BFlat 1350204bfd Merge pull request #7706 from dotCooCoo/feat/3d-graphics-extrude-side
3D: graphics map onto Extrude & Bevel's walls and bevels
2026-11-18 13:13:27 +07:00
dotCooCoo ac6a625d52 Merge main into feat/3d-classic-map-art 2026-11-17 22:03:18 -08:00
dotCooCoo 6016f40cf6 Map Art: a wall set out by a bevel is laid out at its own length
The side surfaces were measured along the traced outline, so with a bevel
added around the shape each wall's art was stretched by the bevel's width
at both ends. Walls are now measured on the ring at the walls' inset, and
a bevel band takes the length of the wall below it. Docs: docs/three-d.md,
docs/mcp.md.
2026-11-17 22:03:06 -08:00
BFlat bbf6165fc8 Merge pull request #8206 from dotCooCoo/feat/packaging-fold-preview
Packaging Tools: Fold Preview folds the blank in 3D with the printed art on its panels
2026-11-18 10:30:50 +07:00
dotCooCoo 7f4e3077f0 3D: Export 3D Object writes the art mapped onto a Revolve's side
Export 3D Object wrote a Revolve as one plain mesh, so graphics mapped
onto its side were left out of the file. The side's triangles are now a
mesh of their own with a PNG texture, as Extrude & Bevel's caps and the
plane already export.

- three-d: revolve_mesh_surface gives, for each triangle of the side,
  the point of the unrolled side each corner shows, from the same layout
  the drawn faces carry (SurfaceCell): around the axis, the angle times
  the distance from it; along the profile, its length. End caps, cut
  sides and other contours of a compound profile carry none.
- effects: a Revolve with graphics splits its mesh into the side, with
  those points as its MeshGraphics art about the side's middle, and the
  rest. In a group, the graphics go on the side of the member with the
  longest profile, as the canvas draws them. A Revolve without graphics
  builds the same single mesh as before.
- The params text of assets.export3D, docs/mcp.md and the progress line
  in docs/target-app-parity.md describe the side textures.
2026-11-17 18:46:19 -08:00
dotCooCoo eb040a8390 Merge main into feat/3d-custom-bevels 2026-11-17 12:41:57 -08:00
dotCooCoo 8920f81410 Merge main into feat/3d-graphics-extrude-side 2026-11-17 12:41:57 -08:00
dotCooCoo 848633a629 Merge main into feat/3d-classic-map-art 2026-11-17 12:37:23 -08:00
dotCooCoo f0305c87a6 Merge main into feat/3d-graphics-inflate 2026-11-17 12:33:11 -08:00
BFlat aab753f4f2 Merge pull request #7819 from dotCooCoo/feat/textures-map-art-and-shading
Export 3D Object: mapped graphics export as textures of their faces
2026-11-18 03:23:34 +07:00
dotCooCoo 4a5931641a 3D: test that Inflate graphics pass over an ear whose new edge runs through a dent
Adds a test for a ring whose first ear's new edge runs through a dent's corner: the ear is passed over, so no triangle edge runs through a corner of the ring.
2026-11-17 05:02:42 -08:00
dotCooCoo 0b87940421 Packaging Tools: Fold Preview halves the print down to one pixel and reads #-named swatches
The print raster stopped after two halvings, so a 2,048-pixel print seen
far out sampled a 512-pixel level and fine art aliased. It is now halved
down to one pixel, and each halving weighs an odd last row or column by
the part of the print it covers, so an edge color does not spread across
a small level.

A swatch whose name starts with # could not be the inside color, and one
named like a hex color drew that hex color. The inside is now looked up
as a swatch first and read as #rrggbb only when no swatch with a plain
color has that name.
2026-11-16 12:26:28 -08:00
dotCooCoo d00e3b6ecd Packaging Tools: Fold Preview picks the print level by a pixel's longer side and draws the board opaque
A print tipped away from the view shrinks up and down but not across, so
the level of the print raster is now chosen by the longer of a pixel's
two sides in flat terms, not its width alone, and fine print lines no
longer alias when the view is tipped.

The board's inside and outside colors were premultiplied by their alpha
and then drawn with full alpha, so a see-through color drew darker
instead. The depth buffer treats every panel as opaque, so the board is
now drawn opaque in its colors' RGB and their alpha is not used.

The tray test now checks that each wall's print faces away from the base
on its own side and that the walls fold below the base.
2026-11-16 12:26:28 -08:00
dotCooCoo cd33666045 Merge main into feat/3d-custom-bevels 2026-11-16 10:35:47 -08:00
dotCooCoo 6076b01b1c Merge main into feat/3d-graphics-extrude-side 2026-11-16 10:34:59 -08:00
dotCooCoo ffb1ebea04 Merge main into feat/3d-graphics-inflate 2026-11-16 10:34:24 -08:00
dotCooCoo 4911e102b1 Packaging Tools: Fold Preview folds the blank in 3D with the printed art on its panels
Fold Preview (Object › Plug-ins › Packaging Tools, and the Fold Lines panel's button) shows the
document's blank folded about its largest panel, or the panel double-clicked. Creases and
perforations fold 90° away from the printed side and partial cuts 90° toward it. Each panel
samples a raster of the print, with the fold lines and non-printing layers left out, through its
projective map, with a depth buffer; the back shows the board's inside color. The window has a
Fold slider, seven view presets, orbit, zoom, pan and perspective, and its status line reports a
joint that does not close and panels that pass through each other.

- addon.packaging.fold returns each panel's frame, the hinges with their angle and gap, and the
  collisions. A closing hinge's gap is measured with every hinge folded all the way.
- ui.foldPreview sets the window and rejects values of the wrong kind or out of range; saved
  settings out of range are brought into range.
- The print renders off the UI thread where a worker exists and once per document revision. The
  fold and the view image are worked out again only when the document, the settings or the
  window's size change.
2026-11-16 10:20:36 -08:00
dotCooCoo 9e76750a96 Merge main into feat/3d-classic-map-art 2026-11-16 08:27:46 -08:00
dotCooCoo f54a3faa39 Packaging Tools: Check Fold Lines reports overshooting and stacked fold lines
- A crease that runs past the cut outline by the tolerance or more is
  reported as outside, though its hinge is still built.
- Two lines that fold, of any role, on top of each other are reported as
  duplicate; a line drawn twice is still checked for where it lies.
- Hidden lines are left out in every scope, members of a selected group
  included.
- The ids scope gets its own noCut message.
- The notStraight, ambiguous and summary texts say what the check finds:
  the summary counts hinges, not creases.
- The fold angle fields, which nothing in this change reads, are removed.
- A window drawn as open cut lines stays a hole when a cut line crosses
  it or when slits join it to an outline of open lines, so that three
  lines meet at a corner. Cut lines drawn whole that cross a cell leave
  it material.
- A slot drawn across the outline is a notch, not a hole, as when the
  notch is drawn in the outline; a crease in it lies outside the blank.
- notStraight measures each hinge piece at its farthest point from the
  hinge line instead of at five samples.
- Cut lines drawn on top of each other so many times that the gap search
  would look at more than 16,777,216 pairs are reported as tooComplex
  before the search.
2026-11-16 04:10:41 -08:00
dotCooCoo 532d2ea6d7 Packaging Tools: Check Fold Lines finds the panels and hinges of a blank and lists what is wrong
Object › Plug-ins › Packaging Tools › Check Fold Lines, and the Fold Lines
panel's Check button, check the fold lines of the selection, or of the
document while nothing is selected (`addon.packaging.check`).

- Cut lines bound the material: each connected piece that encloses an
  area is one blank, its largest closed cut line is the outline, and a
  closed cut line inside it is a hole. A slot drawn as a rectangle across
  the outline leaves the same material as a notch drawn in it, and an
  outline drawn as several open cut lines works too.
- Creases, partial cuts and perforations divide a blank into panels; the
  pieces between the same two panels form one hinge.
- 15 issue codes, errors and warnings, each naming its lines; cut line
  ends within a tolerance (0.1 pt, 0.01 to 10) are joined and reported as
  a gap. With `select`, the lines the issues name are selected.
- The panel lists the issues in the interface language, with a summary
  line; clicking an issue or its Select button selects its lines. The
  list is kept until the document changes.

`vectorcraft_pathops::adjacency` maps paths as live_paint does and keeps,
for each edge, every input it lies on and the faces on both sides; the
blank model is `vectorcraft_three_d::fold::blanks`. The engine now depends
on vectorcraft-three-d directly.

Docs: docs/mcp.md (Check Fold Lines), crates/pathops/README.md, ROADMAP.
2026-11-16 01:47:15 -08:00
dotCooCoo f2376b05f7 3D: Inflate graphics keep membrane corners on an ear's new edge
With corners kept along a cell's edges, ear clipping could still take an ear whose new edge ran through kept corners, leaving them off every triangle and the triangles beside them flat. Such an ear is now passed over. docs/three-d.md now says that a membrane cell that cannot be cut into triangles makes the object draw without its graphics, and commands refuse them.
2026-11-16 00:13:32 -08:00
dotCooCoo 2c4bd7c88e Merge main into feat/3d-graphics-inflate 2026-11-15 22:16:19 -08:00
dotCooCoo 1d082e161e Merge main into feat/3d-graphics-extrude-side 2026-11-15 22:10:50 -08:00
dotCooCoo 66b0aa4995 Merge main into feat/3d-custom-bevels 2026-11-15 22:09:03 -08:00
dotCooCoo 6e80aa6fc2 Merge main into feat/3d-classic-map-art 2026-11-15 22:08:30 -08:00
dotCooCoo ea42075eb8 Merge main into feat/3d-soft-shadows 2026-11-15 20:12:19 -08:00
dotCooCoo 5a230be1bc Merge main into feat/3d-graphics-extrude-side 2026-11-15 20:02:35 -08:00
dotCooCoo 62204d9897 Merge main into feat/3d-custom-bevels 2026-11-15 19:52:16 -08:00
dotCooCoo 46aa337123 Merge main into feat/3d-graphics-inflate 2026-11-15 19:51:55 -08:00
dotCooCoo 5dea503631 Merge main into feat/3d-classic-map-art 2026-11-15 19:42:25 -08:00
dotCooCoo a191b0dae5 Revolve: closed subpaths close the cut sides with what the fill rule fills
The closed subpaths of a profile now close a partial sweep's cut sides
together, with the area the object's fill rule fills, instead of one
region per subpath marked as a hole by most of its edges. Two closed
subpaths that overlap with only a corner inside each other no longer
fill their overlap under the even-odd rule, and under the nonzero rule
the overlap is filled once.

The cut-side regions are taken after the profile gets the anchor where
a mapped side is cut, so the cut sides kept for a mesh have a corner at
every corner of the edge they share with the side.
2026-11-15 12:20:09 -08:00