mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2025-04-21 12:27:27 +03:00
Added override (in gnuplot file) for inside/outside path detection.
- cameo/cameo.c (process_paths): explain the inside/outside path detection heuristics - cameo/path.h (struct path), cameo/path.c (path_new): added attribute "outside" to explicitly mark paths as outside edges - cameo/path.c (path_from): new function to make a path that takes the attributes of another path - cameo/path.c (path_reverse, path_offset): use path_from instead of path_new - cameo/gnuplot.c (gnuplot_read, gnuplot_do_write): read and write the #%outside hint
This commit is contained in:
@@ -37,10 +37,24 @@ static void process_paths(struct path *paths)
|
||||
{
|
||||
struct path *leftmost, *path;
|
||||
|
||||
/*
|
||||
* We don't have an algorithm (yet) that can detect which paths are
|
||||
* inside other paths. Therefore, we fake it by looking for the path
|
||||
* that contains lowest x coordinate. This ought to be the outer
|
||||
* boundary of the piece.
|
||||
*
|
||||
* Note that this heuristic falls apart when a job consists of
|
||||
* multiple pieces. In this case, the #%outside hint can be used to
|
||||
* explicitly tell cameo to treat the path as an outside edge.
|
||||
*/
|
||||
|
||||
leftmost = path_find_leftmost(paths);
|
||||
for (path = paths; path; path = path->next)
|
||||
if (path != leftmost)
|
||||
if (path != leftmost && !path->outside)
|
||||
process_path(path, 1);
|
||||
for (path = paths; path; path = path->next)
|
||||
if (path != leftmost && path->outside)
|
||||
process_path(path, 0);
|
||||
process_path(leftmost, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user