FIX:HeightRange must use world cs

jira: none
Change-Id: Ib0d1efa0a5b2f389d3ec0ff68f82af503084605a
This commit is contained in:
zhou.xu 2025-02-24 21:01:19 +08:00 committed by lane.wei
parent ebc30a7769
commit bcbb08c303
2 changed files with 12 additions and 2 deletions

View File

@ -1094,6 +1094,17 @@ bool TriangleSelector::Circle::is_edge_inside_cursor(const Triangle &tr, const s
return false;
}
TriangleSelector::HeightRange::HeightRange(float z_world_, const Vec3f &source_, float height_, const Transform3d &trafo_, const ClippingPlane &clipping_plane_)
: SinglePointCursor(Vec3f(0.f, 0.f, 0.f), source_, 1.f, trafo_, clipping_plane_), m_z_world(z_world_), m_height(height_)
{
uniform_scaling = false;//HeightRange must use world cs
// overwrite base
source = trafo * source;
radius = height_;
radius_sqr = Slic3r::sqr(height_);
trafo_normal = trafo.linear().inverse().transpose();
}
// BBS
bool TriangleSelector::HeightRange::is_pointer_in_triangle(const Vec3f& p1_, const Vec3f& p2_, const Vec3f& p3_) const
{

View File

@ -161,8 +161,7 @@ public:
public:
HeightRange() = delete;
// BBS: set cursor_radius to 0.1 for high smooth edge
explicit HeightRange(float z_world_, const Vec3f& source_, float height_, const Transform3d& trafo_, const ClippingPlane& clipping_plane_)
: SinglePointCursor(Vec3f(0.f, 0.f, 0.f), source_, 1.f, trafo_, clipping_plane_), m_z_world(z_world_), m_height(height_) {}
explicit HeightRange(float z_world_, const Vec3f &source_, float height_, const Transform3d &trafo_, const ClippingPlane &clipping_plane_);
~HeightRange() override = default;
bool is_pointer_in_triangle(const Vec3f& p1, const Vec3f& p2, const Vec3f& p3) const override;