Class-A surfacing 3/3: blend curves, curved-edge fillets, the G2 corner and continuity analysis (#1642)
Thanks @midasdf.
This commit is contained in:
1 parent
3126962cd4
commit
bbd4f29ebb
43 files changed
+4753
-132
No files matched your search
@@ -621,7 +621,7 @@ pub fn for_feature(app: &SolveApp, kind: &FeatureKind, frame: &Mat) -> Option<(K
|
||||
],
|
||||
)
|
||||
}
|
||||
FeatureKind::SurfaceLoft { sections } => {
|
||||
FeatureKind::SurfaceLoft { sections, .. } => {
|
||||
(Surf::Loft, vec![sections.iter().flat_map(|sec| sheet_sels(app, sec.sketch.0, sec.profiles.as_ref(), &sec.curves)).collect()])
|
||||
}
|
||||
FeatureKind::SurfaceExtrude { sketch, profiles, curves, extent } => {
|
||||
|
||||
@@ -682,10 +682,33 @@ fn build_scene(app: &SolveApp) -> GpuScene {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Continuity analysis: each seam `inspect.continuity` measured, drawn over the model in the
|
||||
// colour of its worst verdict.
|
||||
for seam in &s.continuity {
|
||||
let col = continuity_color(seam.verdict);
|
||||
for w in seam.points.windows(2) {
|
||||
if let (Some(a), Some(b)) = (w.first(), w.get(1)) {
|
||||
sc.line(a.to_f32(), b.to_f32(), col, 2.6, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sc
|
||||
}
|
||||
|
||||
/// The colour of a measured seam: green within every tolerance, yellow where the faces only
|
||||
/// meet at an angle (over G1), red where they do not meet at all or the curvature jumps across
|
||||
/// them (over G2, the defect no chord tolerance shows). The greens, yellows and reds are the
|
||||
/// ones the shader's own analyses use (`assets/shaders/viewport.wgsl`).
|
||||
fn continuity_color(verdict: solidcraft_engine::kernel::SeamVerdict) -> [u8; 4] {
|
||||
use solidcraft_engine::kernel::SeamVerdict as V;
|
||||
match verdict {
|
||||
V::Smooth => [51, 191, 77, 255],
|
||||
V::Sharp => [242, 204, 38, 255],
|
||||
V::CurvatureJump | V::Gap => [217, 56, 51, 255],
|
||||
}
|
||||
}
|
||||
|
||||
/// A soft dark ellipse on the ground under the shown bodies (darkest in the middle).
|
||||
fn build_sketch_scene(app: &SolveApp, proj: &Proj) -> GpuScene {
|
||||
let tk = Tokens::get();
|
||||
|
||||
Reference in new issue
Block a user