mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-27 19:27:21 -06:00
3D and Materials: Perspective runs 0° to 160°, as documented
The public 3D and Materials panel options give Perspective as 0° to 160°
("how close or far the object appears"); it was a 0–100 % strength, for
Revolve, Extrude & Bevel, Inflate and Rotate alike.
- The eye stands where a sphere about the object's centre, √3 times its
half size (the box around it fits inside), fills that angle of the
view: 0° is none, wider brings the eye nearer, and at 160° it is just
outside the sphere, never inside the object. The documentation doesn't
say how the angle places the eye; docs/three-d.md says this is our
reading.
- `perspectiveAngle` (degrees) replaces `perspective` (%). A strength from
an earlier file or script is read as the angle that shows exactly the
same view: sin(angle / 2) = √3 × strength / 4, 100 % about 51.3°. An
angle given too wins. effect.setParams turns a stored strength into the
angle before applying new values. The parameter description names
`perspective` as the earlier form, so effect.apply and effect.setParams
still take it under the key check of #1592. Old and new code draw the four effects identically at 0, 25,
60 and 100 % (bounds equal to 1e-9).
- The dialogs' Perspective fields run 0–160°.
# Conflicts:
# docs/target-app-parity.md
This commit is contained in:
+17
-3
@@ -8,7 +8,7 @@ Select a path or compound path, then choose **Effect › 3D and Materials › Ex
|
||||
**Rotate…**. The options dialog opens beside the artboard with tabs:
|
||||
|
||||
- **Object** (Extrude & Bevel and Inflate): the shape's own options, below.
|
||||
- **Rotation**: a **Presets** menu, **Rotation X/Y/Z** (−180° to 180°) and **Perspective**. The rotation rings
|
||||
- **Rotation**: a **Presets** menu, **Rotation X/Y/Z** (−180° to 180°) and **Perspective** (0° to 160°, below). The rotation rings
|
||||
on the artboard turn the object about the centre of its bounds; Shift snaps to 15°.
|
||||
- **Lighting**: **Shading**, the light's **Direction** and **Elevation** (or drag the light on the artboard),
|
||||
**Intensity** and **Ambient**, as for Revolve.
|
||||
@@ -66,12 +66,27 @@ of an isometric view (each visible axis foreshortened equally). These are our ow
|
||||
each view; the dialog shows a preset's name when the angles match it and **Custom** otherwise. The new effects
|
||||
open at Off-Axis Front.
|
||||
|
||||
## Perspective
|
||||
|
||||
**Perspective** runs 0° to 160°, as the public panel options give it ("how close or far the object appears"),
|
||||
for Revolve too. The documentation doesn't say how the angle places the eye; our reading: the eye stands where a
|
||||
sphere about the object's centre fills that angle of the view, the sphere's radius √3 times the object's size
|
||||
(for Extrude & Bevel, Inflate and Rotate half its largest side, depth included; for Revolve the larger of its
|
||||
radius and its height, the sizes the earlier strength used), so the object fits inside it. 0° is no
|
||||
perspective; wider angles bring the eye nearer, and at 160° it is just outside that sphere, so never inside the
|
||||
object. Default 0°, as before.
|
||||
|
||||
Effects saved before the angle (and scripts) give `perspective` as a 0–100 % strength. It is read as the angle
|
||||
that shows exactly the same view: the strength put the eye at 4 × that size / strength, so
|
||||
sin(angle / 2) = √3 × strength / 4, and 100 % is about 51.3°. An angle given as well wins; the dialog shows and
|
||||
saves the angle.
|
||||
|
||||
## Parameters (`effect.apply`, `effect.setParams`)
|
||||
|
||||
`threeD.extrude`: `depth`, `twist`, `taper` (%), `cap`, `bevel` (`none`, `classic`, `rounded`, `cove`, `step`,
|
||||
`ogee`), `bevelWidth`, `bevelHeight`, `bevelRepeat`, `bevelSpace` (%), `bevelInside`, `bevelBothSides`.
|
||||
`threeD.inflate`: `depth`, `volume` (%), `bothSides`. All three take the view and lighting parameters Revolve
|
||||
uses: `rotationX`, `rotationY`, `rotationZ`, `perspective` (%), `shade`, `lightAzimuth`, `lightElevation`,
|
||||
uses: `rotationX`, `rotationY`, `rotationZ`, `perspectiveAngle` (degrees), `shade`, `lightAzimuth`, `lightElevation`,
|
||||
`lightIntensity` (%), `ambient` (%). Lengths are points and scale with the object (Scale Strokes & Effects).
|
||||
Commands validate the shape and the parameters before the document changes.
|
||||
|
||||
@@ -85,7 +100,6 @@ out, perspective). No Adobe software, assets, presets or bevel shapes were used.
|
||||
- **Materials** (base, Adobe Substance and graphics), **several lights**, light colour and softness, **shadows**
|
||||
and **ray-traced rendering** are not built: shading is one directional light, flat per face, painted with the
|
||||
object's top fill (else its top stroke) for Extrude & Bevel and Inflate.
|
||||
- **Perspective** is a 0–100 % strength, as Revolve's, not a 0–160° lens angle.
|
||||
- The bevel shapes and their names are our own; custom bevel paths are not supported.
|
||||
- Visibility is a painter's algorithm: faces of a closed solid turned away are left out, the rest drawn back to
|
||||
front. Concave solids seen at steep angles can overlap wrongly; open (hollow) solids show both sides.
|
||||
|
||||
Reference in New Issue
Block a user