Browse Source

fix: helixline lefthanded error

main
linchforever 1 day ago
parent
commit
17f417a853
  1. 9
      primitive_process/interface/subface/simple/extrude_polyline_side_face.hpp
  2. 5
      primitive_process/src/subface/geometry/extrude_helixline_geometry.cpp

9
primitive_process/interface/subface/simple/extrude_polyline_side_face.hpp

@ -9,8 +9,8 @@ namespace internal
{ {
// ==================== 前置声明:辅助函数 ==================== // ==================== 前置声明:辅助函数 ====================
paired_model_matrix compute_polyline_bottom_cap_matrix(const polyline_descriptor_t& desc); paired_model_matrix compute_polyline_bottom_cap_matrix(const extrude_polyline_geometry_t& geom);
paired_model_matrix compute_polyline_top_cap_matrix(const polyline_descriptor_t& desc); paired_model_matrix compute_polyline_top_cap_matrix(const extrude_polyline_geometry_t& geom);
// ==================== Polyline 拉伸侧面 ==================== // ==================== Polyline 拉伸侧面 ====================
@ -77,13 +77,14 @@ struct extrude_polyline_side_face_t : subface {
internal::paired_model_matrix get_bottom_cap_matrix() const internal::paired_model_matrix get_bottom_cap_matrix() const
{ {
assert(geometry_ptr); assert(geometry_ptr);
return compute_polyline_bottom_cap_matrix(geometry_ptr->descriptor.axis); // 传入完整几何对象,使 calculate_tangent() 能正确处理圆弧段
return compute_polyline_bottom_cap_matrix(*geometry_ptr);
} }
internal::paired_model_matrix get_top_cap_matrix() const internal::paired_model_matrix get_top_cap_matrix() const
{ {
assert(geometry_ptr); assert(geometry_ptr);
return compute_polyline_top_cap_matrix(geometry_ptr->descriptor.axis); return compute_polyline_top_cap_matrix(*geometry_ptr);
} }
}; };

5
primitive_process/src/subface/geometry/extrude_helixline_geometry.cpp

@ -34,10 +34,9 @@ void extrude_helixline_geometry_t::build()
const auto& matrix_handle = this->axis_to_world.matrix(); const auto& matrix_handle = this->axis_to_world.matrix();
const Eigen::Vector3d N = -matrix_handle.col(0); const Eigen::Vector3d N = -matrix_handle.col(0);
const Eigen::Vector3d T = (matrix_handle.col(2) * this->axis_geom.height const Eigen::Vector3d B = (this->axis_geom.height * matrix_handle.col(1)
+ this->axis_geom.radius * this->axis_geom.total_theta * matrix_handle.col(1)) - this->axis_geom.radius * this->axis_geom.total_theta * matrix_handle.col(2))
.normalized(); .normalized();
const Eigen::Vector3d B = N.cross(T);
// 构建 profile 几何数据(使用插入圆角后的 descriptor) // 构建 profile 几何数据(使用插入圆角后的 descriptor)
aabb_t_dim<2> profile_aabb; aabb_t_dim<2> profile_aabb;

Loading…
Cancel
Save