mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-22 06:04:01 -06:00
Removed the PRUS format parser. WIP: admesh eradication:
stl_stats are newly only accessed by TriangleMesh::stats(), most of the direct access to TriangleMesh::stl is gone with the exception of parsing input files (3MF, AMF, obj).
This commit is contained in:
parent
1c6ecd9c1a
commit
58d8ab3dea
22 changed files with 149 additions and 159 deletions
|
@ -8,8 +8,9 @@
|
|||
#include "slic3r/GUI/GUI_App.hpp"
|
||||
#include "slic3r/GUI/Camera.hpp"
|
||||
#include "slic3r/GUI/Plater.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/TriangleMesh.hpp"
|
||||
|
||||
|
||||
|
||||
|
@ -20,17 +21,10 @@ GLGizmoPainterBase::GLGizmoPainterBase(GLCanvas3D& parent, const std::string& ic
|
|||
: GLGizmoBase(parent, icon_filename, sprite_id)
|
||||
{
|
||||
// Make sphere and save it into a vertex buffer.
|
||||
const TriangleMesh sphere_mesh = make_sphere(1., (2*M_PI)/24.);
|
||||
for (size_t i=0; i<sphere_mesh.its.vertices.size(); ++i)
|
||||
m_vbo_sphere.push_geometry(sphere_mesh.its.vertices[i].cast<double>(),
|
||||
sphere_mesh.stl.facet_start[i].normal.cast<double>());
|
||||
for (const stl_triangle_vertex_indices& indices : sphere_mesh.its.indices)
|
||||
m_vbo_sphere.push_triangle(indices(0), indices(1), indices(2));
|
||||
m_vbo_sphere.load_its_flat_shading(its_make_sphere(1., (2*M_PI)/24.));
|
||||
m_vbo_sphere.finalize_geometry(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// port of 948bc382655993721d93d3b9fce9b0186fcfb211
|
||||
void GLGizmoPainterBase::activate_internal_undo_redo_stack(bool activate)
|
||||
{
|
||||
|
@ -632,9 +626,15 @@ void TriangleSelectorGUI::update_render_data()
|
|||
|
||||
GLIndexedVertexArray &iva = tr.get_state() == EnforcerBlockerType::ENFORCER ? m_iva_enforcers : m_iva_blockers;
|
||||
int & cnt = tr.get_state() == EnforcerBlockerType::ENFORCER ? enf_cnt : blc_cnt;
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
iva.push_geometry(m_vertices[tr.verts_idxs[i]].v, m_mesh->stl.facet_start[tr.source_triangle].normal);
|
||||
const Vec3f &v0 = m_vertices[tr.verts_idxs[0]].v;
|
||||
const Vec3f &v1 = m_vertices[tr.verts_idxs[1]].v;
|
||||
const Vec3f &v2 = m_vertices[tr.verts_idxs[2]].v;
|
||||
//FIXME the normal may likely be pulled from m_triangle_selectors, but it may not be worth the effort
|
||||
// or the current implementation may be more cache friendly.
|
||||
const Vec3f n = (v1 - v0).cross(v2 - v1).normalized();
|
||||
iva.push_geometry(v0, n);
|
||||
iva.push_geometry(v1, n);
|
||||
iva.push_geometry(v2, n);
|
||||
iva.push_triangle(cnt, cnt + 1, cnt + 2);
|
||||
cnt += 3;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue