forked from 1b-agent/opencadstudio-upstream
Feat: ROADMAP Phase 1-5 batch — trim/extend, plot scale, viewport UX, mline caps, table alignment
- TRIM/EXTEND: Ray and XLine entities supported as cutting boundaries and trim targets; trim results in Ray→Line/Ray, XLine→Ray/Ray or Line; hover preview added - Plot scale override: Fit/1:1/1:2/1:5/1:10/1:20/1:50/1:100/2:1 buttons added to Page Setup panel; PageSetupCommit applies scale to PlotSettings - Viewport UX: locked viewport gets orange border; selected viewport gets white border - Named view → viewport assignment: Choice dropdown in properties panel copies view_target/direction/height to the viewport entity - MLine caps: perpendicular start/end cap lines added for open (non-closed) MLines - Wipeout polygon grips: boundary vertices become editable grips when clipping_enabled+Polygonal; world→pixel back-projection on drag - Table cell alignment: CellStyle.alignment (1-9) drives left/center/right + top/middle/bottom text positioning; cxf::measure_text() helper added - New commands/features: DIMCONTINUE (DCO), DIMBASELINE (DBA), TOLERANCE (TOL), TABLE, ATTDEF, ATTEDIT, ATTDISP, BREAKATPOINT (BAP), PLOTWINDOW (PW), MLINE (ML); DIMSTYLE/DIMCURRENT/CLAYER/LTSCALE/CELTSCALE/SCALETEXT/XDATA/UCSICON/REGEN/DRAWORDER extended - PLINE arc mode: A/L/CLOSE text input, bulge computation, arc preview - Warning cleanup: removed unused imports and unreachable patterns Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
27b5e124c7
commit
0aef1fc12f
27 files changed
+2217
-100
No files matched your search
+23
-2
@@ -38,8 +38,9 @@ impl TruckConvertible for MLine {
|
||||
// Parallel offset lines — one at +scale/2 and one at -scale/2
|
||||
// along each vertex's miter direction.
|
||||
if scale.abs() > 1e-6 {
|
||||
for sign in [-0.5_f32, 0.5_f32] {
|
||||
let offset = scale * sign;
|
||||
let half = scale * 0.5;
|
||||
for sign in [-1.0_f32, 1.0_f32] {
|
||||
let offset = half * sign;
|
||||
pts.push([f32::NAN; 3]);
|
||||
for v in &self.vertices {
|
||||
let mx = v.miter.x as f32;
|
||||
@@ -63,6 +64,26 @@ impl TruckConvertible for MLine {
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Start and end caps: perpendicular line connecting the two offset lines
|
||||
// at the first and last vertex of an open MLine.
|
||||
if !closed {
|
||||
let cap_v = |v: &acadrust::entities::MLineVertex| {
|
||||
let mx = v.miter.x as f32;
|
||||
let my = v.miter.y as f32;
|
||||
let mz = v.miter.z as f32;
|
||||
let px = v.position.x as f32;
|
||||
let py = v.position.y as f32;
|
||||
let pz = v.position.z as f32;
|
||||
[
|
||||
[f32::NAN; 3],
|
||||
[px + mx * (-half), py + my * (-half), pz + mz * (-half)],
|
||||
[px + mx * half, py + my * half, pz + mz * half ],
|
||||
]
|
||||
};
|
||||
pts.extend_from_slice(&cap_v(&self.vertices[0]));
|
||||
pts.extend_from_slice(&cap_v(&self.vertices[n - 1]));
|
||||
}
|
||||
}
|
||||
|
||||
let key_verts: Vec<[f32; 3]> = self
|
||||
|
||||
Reference in new issue
Block a user