summaryrefslogtreecommitdiff
path: root/render.cc
diff options
context:
space:
mode:
authorclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-28 18:17:29 (GMT)
committerclifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c>2009-07-28 18:17:29 (GMT)
commitcc803576dcc4810d1ba415895b83ac9a3079de2f (patch)
treee5dcee5127de5f867a694e6831b4e0de38b612fd /render.cc
parent8e9b8512367f83e766b1a3676fb326ef216b7e6d (diff)
Clifford Wolf:
Improved animation and polycaching git-svn-id: http://svn.clifford.at/openscad/trunk@85 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'render.cc')
-rw-r--r--render.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/render.cc b/render.cc
index ee03e8c..b9359a5 100644
--- a/render.cc
+++ b/render.cc
@@ -114,6 +114,11 @@ static void report_func(const class AbstractNode*, void *vp, int mark)
CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights, QVector<CSGTerm*> *background) const
{
+ QString key = mk_cache_id();
+ if (PolySet::ps_cache.contains(key))
+ return AbstractPolyNode::render_csg_term_from_ps(m, highlights, background,
+ PolySet::ps_cache[key]->ps->link(), modinst, idx);
+
CGAL_Nef_polyhedron N;
QString cache_id = mk_cache_id();
@@ -175,6 +180,8 @@ CSGTerm *RenderNode::render_csg_term(double m[16], QVector<CSGTerm*> *highlights
} while (hc != hc_end);
}
+ PolySet::ps_cache.insert(key, new PolySetPtr(ps->link()));
+
CSGTerm *term = new CSGTerm(ps, m, QString("n%1").arg(idx));
if (modinst->tag_highlight && highlights)
highlights->append(term->link());
contact: Jan Huwald // Impressum