mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2024-12-22 23:51:08 +02:00
cameo/poly2d.c (paths_to_polys_z): correctly ignore empty paths
This commit is contained in:
parent
4d15951807
commit
c9c0e887e7
@ -1,8 +1,8 @@
|
||||
/*
|
||||
* poly2d.c - Poly2D interface functions
|
||||
*
|
||||
* Written 2012 by Werner Almesberger
|
||||
* Copyright 2012 Werner Almesberger
|
||||
* Written 2012, 2015 by Werner Almesberger
|
||||
* Copyright 2012, 2015 Werner Almesberger
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -11,6 +11,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <assert.h>
|
||||
|
||||
@ -46,6 +47,8 @@ struct p2d *paths_to_polys_z(const struct path *paths,
|
||||
if (path->first->z < zmin || path->first->z > zmax)
|
||||
continue;
|
||||
*last = path_to_poly(path);
|
||||
if (!*last)
|
||||
continue;
|
||||
last = &(*last)->next;
|
||||
}
|
||||
return polys;
|
||||
|
Loading…
Reference in New Issue
Block a user