mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 09:22:58 -05:00
Merge branch 'main' into feature/mcp
This commit is contained in:
commit
822775179b
130 files changed
+6555
-1315
No files matched your search
@@ -362,9 +362,11 @@ void GCodeViewer::SequentialView::Marker::render(int canvas_width, int canvas_he
|
||||
const Camera& camera = wxGetApp().plater()->get_camera();
|
||||
const Transform3d& view_matrix = camera.get_view_matrix();
|
||||
float scale_factor = m_scale_factor;
|
||||
const Transform3d model_matrix = (Geometry::translation_transform((m_world_position + m_model_z_offset * Vec3f::UnitZ()).cast<double>()) *
|
||||
Geometry::translation_transform(scale_factor * m_model.get_bounding_box().size().z() * Vec3d::UnitZ()) * Geometry::rotation_transform({ M_PI, 0.0, 0.0 })) *
|
||||
Geometry::scale_transform(scale_factor);
|
||||
// ORCA Tilt the model around the nozzle tip
|
||||
const Transform3d tilt(Eigen::Quaterniond::FromTwoVectors(Vec3d::UnitZ(), m_nozzle_axis));
|
||||
const Transform3d model_matrix = Geometry::translation_transform(m_world_position.cast<double>()) * tilt *
|
||||
Geometry::translation_transform((m_model_z_offset + scale_factor * m_model.get_bounding_box().size().z()) * Vec3d::UnitZ()) *
|
||||
Geometry::rotation_transform({ M_PI, 0.0, 0.0 }) * Geometry::scale_transform(scale_factor);
|
||||
shader->set_uniform("view_model_matrix", view_matrix * model_matrix);
|
||||
shader->set_uniform("projection_matrix", camera.get_projection_matrix());
|
||||
const Matrix3d view_normal_matrix = view_matrix.matrix().block(0, 0, 3, 3) * model_matrix.matrix().block(0, 0, 3, 3).inverse().transpose();
|
||||
@@ -1582,6 +1584,11 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
|
||||
}
|
||||
libvgcode::GCodeInputData data = libvgcode::convert(gcode_result, str_tool_colors, str_color_print_colors, m_viewer,
|
||||
apply_belt ? &belt_inv : nullptr);
|
||||
// ORCA Tilt the marker to the layer normal of the designed belt view
|
||||
Vec3d nozzle_axis = Vec3d::UnitZ();
|
||||
if (apply_belt)
|
||||
nozzle_axis = BeltTransformPipeline::build_rotation_matrix(print.config()).row(2).transpose();
|
||||
m_sequential_view.marker.set_nozzle_axis(nozzle_axis);
|
||||
|
||||
//#define ENABLE_DATA_EXPORT 1
|
||||
//#if ENABLE_DATA_EXPORT
|
||||
@@ -2422,6 +2429,7 @@ void GCodeViewer::render_markers(int canvas_width, int canvas_height)
|
||||
prim_pos.z() };
|
||||
m_sequential_view.m_imex_secondary_markers[i].set_world_position(sec_pos);
|
||||
m_sequential_view.m_imex_secondary_markers[i].set_z_offset(m_z_offset + 0.5f);
|
||||
m_sequential_view.m_imex_secondary_markers[i].set_nozzle_axis(m_sequential_view.marker.get_nozzle_axis());
|
||||
carriage_box_draws.push_back({
|
||||
sec_pos, carriage_colors[i + 1],
|
||||
carriage.box_offset_x, carriage.box_offset_y });
|
||||
|
||||
Reference in new issue
Block a user