From c6739b6427261ac2682a9fca3b23c98df0dc9f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 6 Nov 2015 07:40:42 +0100 Subject: New upstream release --- rspl/gam.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'rspl') diff --git a/rspl/gam.c b/rspl/gam.c index e46780f..0765e05 100644 --- a/rspl/gam.c +++ b/rspl/gam.c @@ -18,6 +18,52 @@ * Latest simplex/linear equation version. */ +/* + + This probably needs re-writing, since (I think) it doesn't take gamut + self intersection into account. Outline would be: + + Have a spactial cache structure that contains list of potentialy + intersecting triangles for any point. Create this incrementally. + Each triangle can be replaced by a list of fragment triangles + sharing the same plane. + + i.e. + + triangle planes + triangles + edges + vertexes + + Initialization: + + Locate extreme vertex + Locate triangle that uses that vertex that is most elevated + in that direction as initial surface. + Intersect that triangle with all other triangles nearby, and + retain the fragment that has that vertex. + List of open edges is initial triangle edges. + Track outward and inward faces of all triangles in open surface. + + Basic loop: + + While edge list is non-empty { + Locate adjacent triangle that is not part of surface that + is most accutely angled to outside face. + + Intersect that triangle with all other triangles using cache structure, + hanging on to all resulting fragments that are part of that edge. + + Add those fragments to the open surface. + + } + + Each intersection adds new nodes, and splits a triangle into + about 8 smaller triangles. Trick is to avoid slivers and + numerical issues with triangles. +*/ + + /* TTBD: Add ouutput curve lookup callback support. -- cgit v1.2.3