Use Vertex Buffer Objects for rendering of 3D volumes if possible.

This commit is contained in:
bubnikv 2017-03-16 14:02:28 +01:00
parent c32c7fa1dc
commit 7f7d2da5fe
8 changed files with 257 additions and 103 deletions

View file

@ -1353,7 +1353,7 @@ Polygons EdgeGrid::Grid::contours_simplified(coord_t offset) const
return out;
}
#ifdef SLIC3R_GUI
#if 0
void EdgeGrid::save_png(const EdgeGrid::Grid &grid, const BoundingBox &bbox, coord_t resolution, const char *path)
{
unsigned int w = (bbox.max.x - bbox.min.x + resolution - 1) / resolution;

View file

@ -107,7 +107,7 @@ protected:
std::vector<float> m_signed_distance_field;
};
#ifdef SLIC3R_GUI
#if 0
// Debugging utility. Save the signed distance field.
extern void save_png(const Grid &grid, const BoundingBox &bbox, coord_t resolution, const char *path);
#endif /* SLIC3R_GUI */

View file

@ -940,7 +940,7 @@ PrintObjectSupportMaterial::MyLayersPtr PrintObjectSupportMaterial::bottom_conta
::Slic3r::SVG svg(debug_out_path("support-bottom-contacts-simplified-%d-%d.svg", iRun, layer_id), bbox);
svg.draw(union_ex(projection, false), "blue", 0.5);
svg.draw(union_ex(projection_simplified, false), "red", 0.5);
#ifdef SLIC3R_GUI
#if 0
bbox.min.x -= scale_(5.f);
bbox.min.y -= scale_(5.f);
bbox.max.x += scale_(5.f);
@ -1593,12 +1593,12 @@ struct MyLayerExtruded
}
// The source layer. It carries the height and extrusion type (bridging / non bridging, extrusion height).
PrintObjectSupportMaterial::MyLayer *layer;
PrintObjectSupportMaterial::MyLayer *layer;
// Collect extrusions. They will be exported sorted by the bottom height.
ExtrusionEntitiesPtr extrusions;
ExtrusionEntitiesPtr extrusions;
// In case the extrusions are non-empty, m_polygons_to_extrude may contain the rest areas yet to be filled by additional support.
// This is useful mainly for the loop interfaces, which are generated before the zig-zag infills.
Polygons *m_polygons_to_extrude;
Polygons *m_polygons_to_extrude;
};
typedef std::vector<MyLayerExtruded*> MyLayerExtrudedPtrs;