Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,39 @@ contributors, and where a line says so by Skryx Dev:
| `crates/io/tests/data/acad-solids/regions-2013.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), five REGIONs (REGION, SUBTRACT, UNION), saved as DWG 2013 | MIT OR Apache-2.0 | Test drawing for the ACIS region reader: its regions against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/regions-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), five REGIONs (REGION, SUBTRACT, UNION), saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS region reader: its regions against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/regions-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), five REGIONs (REGION, SUBTRACT, UNION), saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS region reader: its regions against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/sab-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SPHERE, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/sab-2004.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SPHERE, saved as DWG 2004 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/sab-2007.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SPHERE, saved as DWG 2007 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/sab-2010.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SPHERE, saved as DWG 2010 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/sab-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SPHERE, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/sab-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SPHERE, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/lumps-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), two separate boxes joined by UNION into one 3DSOLID, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/lumps-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), two separate boxes joined by UNION into one 3DSOLID, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/lumps-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), two separate boxes joined by UNION into one 3DSOLID, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/mirror-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a WEDGE mirrored with MIRROR and a CONE mirrored with MIRROR3D, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/mirror-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a WEDGE mirrored with MIRROR and a CONE mirrored with MIRROR3D, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/mirror-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a WEDGE mirrored with MIRROR and a CONE mirrored with MIRROR3D, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/procsurf-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), FILLETEDGE, SOLIDEDIT face taper and offset, and a SWEEP along a conical HELIX, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/procsurf-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), FILLETEDGE, SOLIDEDIT face taper and offset, and a SWEEP along a conical HELIX, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/procsurf-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), FILLETEDGE, SOLIDEDIT face taper and offset, and a SWEEP along a conical HELIX, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/regions-ucs-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), REGIONs from a rectangle in a rotated UCS, an ELLIPSE and a closed SPLINE, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS region reader: its regions against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/regions-ucs-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), REGIONs from a rectangle in a rotated UCS, an ELLIPSE and a closed SPLINE, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS region reader: its regions against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/regions-ucs-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), REGIONs from a rectangle in a rotated UCS, an ELLIPSE and a closed SPLINE, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS region reader: its regions against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/surfaces-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), PLANESURF, CONVTONURBS and EXTRUDE, LOFT, REVOLVE and SWEEP surfaces, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its surfaces against AutoCAD's LIST and AREA |
| `crates/io/tests/data/acad-solids/surfaces-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), PLANESURF, CONVTONURBS and EXTRUDE, LOFT, REVOLVE and SWEEP surfaces, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its surfaces against AutoCAD's LIST and AREA |
| `crates/io/tests/data/acad-solids/surfaces-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), PLANESURF, CONVTONURBS and EXTRUDE, LOFT, REVOLVE and SWEEP surfaces, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its surfaces against AutoCAD's LIST and AREA |
| `crates/io/tests/data/acad-solids/mesh-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a MESH box and a copy smoothed with MESHSMOOTHMORE, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the mesh reader: its meshes against AutoCAD's LIST and AREA |
| `crates/io/tests/data/acad-solids/mesh-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a MESH box and a copy smoothed with MESHSMOOTHMORE, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the mesh reader: its meshes against AutoCAD's LIST and AREA |
| `crates/io/tests/data/acad-solids/mesh-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a MESH box and a copy smoothed with MESHSMOOTHMORE, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the mesh reader: its meshes against AutoCAD's LIST and AREA |
| `crates/io/tests/data/acad-solids/history-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SUBTRACT with SOLIDHIST 1, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/history-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SUBTRACT with SOLIDHIST 1, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/history-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), BOX, CYLINDER and SUBTRACT with SOLIDHIST 1, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/facecolor-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a BOX with its top face coloured red by SOLIDEDIT, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/facecolor-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a BOX with its top face coloured red by SOLIDEDIT, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/facecolor-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), a BOX with its top face coloured red by SOLIDEDIT, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the ACIS reader: its 3D solids against AutoCAD's MASSPROP |
| `crates/io/tests/data/acad-solids/legacy3d-2000.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), 3DFACE, 3DPOLY, 3D LINE, CIRCLEs with thickness and in a rotated UCS, 3DMESH and PFACE, saved as DXF 2000 | MIT OR Apache-2.0 | Test drawing for the reader: legacy 3D entities against AutoCAD's LIST |
| `crates/io/tests/data/acad-solids/legacy3d-2018.dwg` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), 3DFACE, 3DPOLY, 3D LINE, CIRCLEs with thickness and in a rotated UCS, 3DMESH and PFACE, saved as DWG 2018 | MIT OR Apache-2.0 | Test drawing for the reader: legacy 3D entities against AutoCAD's LIST |
| `crates/io/tests/data/acad-solids/legacy3d-2018.dxf` | DraftCraft contributors | drawn for this project in AutoCAD 2027 for Mac (educational licence), 3DFACE, 3DPOLY, 3D LINE, CIRCLEs with thickness and in a rotated UCS, 3DMESH and PFACE, saved as DXF 2018 | MIT OR Apache-2.0 | Test drawing for the reader: legacy 3D entities against AutoCAD's LIST |

## Interface translations

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ How to write it (see AGENTS.md):
## Unreleased

### New
- 3DMOVE, 3DROTATE, ROTATE3D, 3DSCALE, MIRROR3D, 3DALIGN and 3DARRAY move, turn, scale, mirror, align and array objects in space, under Modify ▸ 3D Operations, with AutoCAD's prompts and aliases (3M, 3R, 3AL, 3A).
- LINE takes points in space: type x,y,z or @dx,dy,dz and the line keeps its height.
- The command line's AutoComplete learns which commands you use: the ones you run most, and most recently, move up the list, so typing LI soon offers LINE first if you draw lines more than you list. The arrow keys move through the suggestions, and Reset Suggestion Order in the command line's right-click menu forgets what was learned.

### Improved
Expand Down
11 changes: 9 additions & 2 deletions crates/doc/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ mod dim;
mod fill;
mod layout;
mod text;
mod transform3;
mod wipeout;
pub use transform3::NotIn3d;

pub use block::{Attrib, AttribModes, AttribProps, Insert, MultilineAttrib, mtext_literal};
pub use common::{Common, Handle, Lineweight, RawTag, Transparency};
Expand Down Expand Up @@ -491,7 +493,12 @@ impl EntityKind {
/// already scales (text and helix heights, an insert's Z scale) are left alone; splines,
/// regions and wipeouts lie in the XY plane.
pub fn scale_heights(&mut self, base_z: f64, f: f64) {
let scale = |h: &mut f64| *h = base_z + (*h - base_z) * f;
self.map_heights(f, base_z * (1.0 - f));
}

/// Map every height of the object `h ↦ a h + b` (see [`EntityKind::scale_heights`]).
pub fn map_heights(&mut self, a: f64, b: f64) {
let scale = |h: &mut f64| *h = a * *h + b;
let z = |p: &mut Vec3| scale(&mut p.z);
let text_z = |t: &mut Text| {
z(&mut t.insert);
Expand Down Expand Up @@ -563,7 +570,7 @@ impl EntityKind {
EntityKind::Solid(so) | EntityKind::Trace(so) => so.corners.iter_mut().for_each(z),
EntityKind::Face3d(fc) => fc.corners.iter_mut().for_each(z),
EntityKind::PolyfaceMesh(m) => m.vertices.iter_mut().for_each(z),
EntityKind::Solid3d(so) => so.scale_heights(base_z, f),
EntityKind::Solid3d(so) => so.map_heights(a, b),
EntityKind::Viewport(v) => z(&mut v.center),
EntityKind::Image(i) => z(&mut i.insert),
EntityKind::Table(t) => z(&mut t.insert),
Expand Down
12 changes: 9 additions & 3 deletions crates/doc/src/entity/solid3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,22 @@ impl Solid3d {
/// Scale the solid's heights by `f` about the height `base_z` (SCALE, with
/// [`Solid3d::transform`]).
pub fn scale_heights(&mut self, base_z: f64, f: f64) {
self.map_heights(f, base_z * (1.0 - f));
}

/// Map the solid's heights `z ↦ a z + b`.
pub fn map_heights(&mut self, a: f64, b: f64) {
let mut t = Mat4::IDENTITY;
t.m[2][2] = f;
t.m[2][3] = base_z * (1.0 - f);
t.m[2][2] = a;
t.m[2][3] = b;
self.placement = t.mul(&self.placement);
self.volume *= f.abs();
self.volume *= a.abs();
}

/// Apply a 3D transform of the drawing.
pub fn transform3(&mut self, m: &Mat4) {
self.placement = m.mul(&self.placement);
self.volume *= m.det3().abs();
}

/// Whether the placement mirrors the body (a negative determinant): its triangles then wind
Expand Down
Loading
Loading