Commit Graph
193 Commits
Author SHA1 Message Date
dotCooCoo 7253b85872 Docs: limit material shading claims to shaded, non-wireframe surfaces
The progress line now says the metallic-roughness shading applies with
Shading on and outside Wireframe mode, and that USD export writes
metallic only when it is not the default 0. The 3D page says the
material does not change Wireframe edges and still exports.
2026-11-30 15:52:25 -08:00
dotCooCoo 3b37cc5e9a 3D: a material drag brought back to its start leaves the effect as it was
A Roughness or Metallic drag that returned to its starting value kept the
last preview in the document, and the release committed it. A drag back
to the start now restores the effect while held, and its release records
no undo step. A setting brought back during a drag that changes another
one is left in its stored form, and the Properties fields stand in for
`material` so an object that only writes out a left-out default is not a
change.

Docs: the material module notes that the drawn paint stops at 1 and that
the highlight is screened; docs/mcp.md says the BRDF applies in shaded
rendering and that USD's `inputs:metallic` is written only when Metallic
is not 0; docs/three-d.md says a mixed number is shown blank;
docs/effects-parity.md lists no base-material library.
2026-11-30 04:39:53 -08:00
dotCooCoo b8b8f4c110 Merge main into feat/vector-3d-materials 2026-11-29 23:33:15 -08:00
dotCooCoo 6866aa8190 3D: Roughness and Metallic on the Materials tab shade and export the surface
Extrude & Bevel, Revolve, Inflate and Rotate take a `material` parameter,
{roughness, metallic}, each a number from 0 to 1 (defaults 1 and 0). The
3D and Materials panel's Materials tab shows them under Properties as two
sliders; each change is one undo step for every selected 3D object. A
value the selected objects hold differently is shown blank with its reset
dot filled, and a typed or dragged value or a reset sets it on all of
them while each keeps its own value of the other property.

- The default material draws exactly as before and calls no BRDF.
- Any other material is shaded through craft-pbr with the glTF 2.0
  metallic-roughness BRDF (Appendix B, with the separable Smith
  visibility of B.3.2) for each light and a split-sum environment scaled
  by Ambient Light. The reflected light is screened over each face as
  vector gradient ramps; graphics on a side or on Inflate's faces lie
  under it, and graphics on caps and the plane take the cap's mean
  reflected light in their colors.
- Smoothed bevel bands take the normals they share at their edges and
  draw as two triangles, so neighboring bands meet without a step, with
  perspective and twist too. A bevel whose split bands would pass the
  solid's face limit keeps one facet per band, so a material never makes
  a solid that draws with the default material too complex. Wireframe
  mode draws the same edges for every material.
- A gradient with transparent stops stays transparent: the faces are drawn
  opaque under one mask of its coverage. A pattern surface takes no
  highlight.
- glTF exports write roughnessFactor and metallicFactor, and USD exports
  write inputs:roughness and inputs:metallic (when it is not 0). OBJ's
  MTL writes neither, so parts of one color and picture share one OBJ
  material as before.
- A material that is not an object, an unknown key, or a value that is not
  a number from 0 to 1 is refused; the 3D (Classic) effects take none. A
  loaded material that fails these rules draws as the default.

Docs: docs/three-d.md (Material properties; the Inflate graphics text is
corrected; the Properties are listed as built), README, docs/mcp.md,
docs/effects-parity.md, docs/target-app-parity.md, ROADMAP.
2026-11-29 23:32:57 -08:00
dotCooCoo 45b0cb12f0 Docs: three-d.md matches what main ships
Graphics map onto Inflate's puffed front and back (#7767), so the
unbuilt list no longer names graphics on Inflate and the Graphics
sentence names Inflate's faces. The 3D (Classic) effects export as
meshes through Asset Export (#6168, #7852), so only Turntable stays
named as unbuilt there.
2026-11-29 18:39:59 -08:00
dotCooCoo 4278fffdb5 3D: count each list entry where it is read, and say what goes next past the step limit
The test counter in RingFinder::reach now counts one entry per read in the compaction loop. docs/three-d.md says that past the limit a face that can go next still goes, and the first face left by depth goes next only when none can.
2026-11-28 09:55:05 -08:00
dotCooCoo 2f1d7a2c8d Merge main into train/carry8496 2026-11-28 09:14:09 -08:00
dotCooCoo 0d5fd64d02 Merge main into fix/classic-3d-unchanged-approval-b 2026-11-28 01:41:16 -08:00
.CooCoo 6545bae486 Merge pull request #9772 from dotCooCoo/fix/track-cube-untouched-axes-b-verify
Preserve untouched Track Cube rotation angles
2026-11-27 22:15:55 -08:00
dotCooCoo 0528468228 Keep unchanged 3D effect options out of Undo and recorded actions 2026-11-27 16:08:40 -08:00
dotCooCoo cc0b8ad623 Preserve untouched Track Cube rotation angles 2026-11-27 07:40:43 -08:00
makesomethingshit 21679b0635 3D: Keep inside bevels within collapsing convex outlines
Part of #7872.
2026-11-27 12:06:49 +09:00
dotCooCoo c48b3e8c93 Merge main into feat/three-d-mesh-attributes 2026-11-21 22:34:22 -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 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
Drew Dibble 28d7b2cafe Merge upstream main into the #7023 ring fix again 2026-11-20 00:11:13 -07: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
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
Drew Dibble 7902e4b56f Merge upstream main into the #7023 ring fix; the roadmap and parity rows say a ring past the step limit breaks as before 2026-11-18 08:32:22 -07: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 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
Drew Dibble fc318eb2c0 3D: a ring of overlapping faces is broken at one of its own faces
Where overlapping faces of a solid are put in the order of their depths
(local_order, also Revolve's surface_order) and some lie in front of
one another in a ring, no order draws them all correctly. When the sort
could draw no face next, it drew the first face left by depth, whether
or not that face was part of a ring. A face that is only in front of a
ring's face, and comes before the ring by depth, was then drawn under
it: dashed strokes on bars that overlap in a ring, extruded as a 3D
group, had whole wall panels drawn over their dashes.

The sort now follows the faces that go before the first face left back,
among the faces that come before the next face drawn last, to a ring
that waits for no other of them (Tarjan's algorithm on the pairs
reversed, stopped at the first component completed). That ring gives up
its own face that comes first in the order of their depths, and the
faces left are looked at afresh, since they may be a smaller ring or
none. Only pairs of a ring, and pairs with a face drawn last, are then
drawn the wrong way round. A face drawn last (a cap) still follows
every face before it.

Cost and memory:
- Comparing pairs and looking for rings share MAX_LOCAL_CHECKS steps:
  every face and pair looked at takes a step, and a face's list of the
  faces before it is charged before it is read. Past the limit the
  first face left by depth goes next, as before.
- A first face left that waits only for the next face drawn last, or
  faces after it, goes next with no search and no step: each face keeps
  a count of the faces not drawn before it that come before the face
  drawn last.
- The search goes on from where it stopped, less the group that gave
  up a face, so rings apart or one behind the other take a few steps a
  face. A ring that is still a ring after it gives up a face is walked
  again, so a large ring can cost about the square of its faces.
- The pairs are held as two u32 (8 bytes), dropped once each face's
  list of the faces after it is made; both kinds of list are one array
  of 4 bytes a pair. The lists of the faces before each face take a
  step a pair to make, not taken from the limit, and are made only when
  the room left is at least a quarter of the pairs, so making them
  costs no more than four times the room left. A solid whose comparing
  leaves less breaks its rings at the first face left by depth.

draw_order, cut_stroke_faces and in_one_order are unchanged.

Tests (solids::tests):
- a_face_in_front_of_a_cycle_waits_for_it: [0, 2, 3, 1] where the
  first face by depth gave [3, 0, 2, 1]; with a cap, it stays last.
- the_faces_left_are_looked_at_afresh_after_each_face_released,
  the_ring_released_waits_for_no_face_outside_it,
  a_ring_is_looked_for_before_the_next_face_drawn_last.
- breaking_a_ring_draws_no_more_pairs_wrong_than_the_first_face_by_depth:
  6,000 random sets (up to 30 faces, pairs shuffled and repeated, up to
  four faces drawn last), each held to the order worked out plainly.
- breaking_rings_stops_at_its_room,
  breaking_rings_takes_a_few_steps_a_face_but_for_a_ring_of_many_pairs:
  the steps are counted, not timed, and bounded from above.
- a_face_that_waits_only_for_the_face_drawn_last_costs_no_search:
  1,000 such faces before a ring take no search.
- the_lists_for_rings_are_made_only_with_room_for_a_quarter_of_the_pairs.
- a_list_longer_than_the_room_left_is_not_read: the entries read are
  counted where they are read, and stay within the room.
- a_depth_cycle_keeps_the_cap_last is unchanged and passes.
With no ring looked for, the ring tests fail; without the skip or the
room for the lists, their tests fail.

Docs: docs/three-d.md, docs/revolve.md, docs/effects-parity.md,
docs/target-app-parity.md.

Part of #7023.
2026-11-17 16:52:48 -07: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
BFlat 89c3a9c4ec Merge pull request #7946 from dotCooCoo/feat/revolve-cut-caps
Revolve: a partial sweep with Cap closes its cut sides
2026-11-16 10:35:40 +07:00
BFlat 3c9249279d Merge pull request #8003 from dotCooCoo/fix/inflate-colored-light-seam-fill
3D: colored Inflate fills each facet and its seam as one path, covering each edge pixel once
2026-11-16 09:31:14 +07:00
dotCooCoo 7c09d22c97 Merge main into feat/revolve-cut-caps 2026-11-15 17:49:31 -08:00
dotCooCoo 6658ceee58 Merge main into feat/3d-graphics-inflate 2026-11-15 17:47:25 -08:00
dotCooCoo 68243f6720 Merge main into feat/3d-graphics-extrude-side 2026-11-15 17:43:44 -08:00
dotCooCoo 121038bd11 Merge main into feat/3d-custom-bevels 2026-11-15 17:33:31 -08:00
dotCooCoo fdf91a9ca4 Merge main into feat/3d-classic-map-art 2026-11-15 17:28:18 -08:00
dotCooCoo 0813f69d0d Merge main into feat/3d-soft-shadows 2026-11-15 17:24:39 -08:00
BFlat abb4af9b87 Merge pull request #7965 from dotCooCoo/fix/export-3d-object-skips-flat-art
3D and Materials: Export 3D Object leaves objects without a 3D effect out in the command
2026-11-16 08:13:27 +07:00
BFlat 2f255f5f99 Merge pull request #7871 from dotCooCoo/feat/3d-classic-black-overprint
3D (Classic): the Black Overprint shading color shades with overprinting black over the fill
2026-11-16 08:13:18 +07:00
BFlat 98a1d0839d Merge pull request #7997 from dotCooCoo/fix/revolve-colored-light-faces-sealed
3D: Revolve's colored-light faces lie over an underlay, so no alpha holes show at 1:1
2026-11-16 08:13:02 +07:00
dotCooCoo 5b323d1a4d Merge main into feat/3d-classic-map-art 2026-11-15 16:06:20 -08:00
dotCooCoo d64310a02a Merge main into feat/3d-custom-bevels 2026-11-15 16:05:52 -08:00