Revision 89 trunk/org.gvsig.dwg/org.gvsig.dwg.lib/src/main/java/org/gvsig/dwg/lib/util/FMapUtil.java

View differences:

FMapUtil.java
35 35
        if (pts.size() < 2) {
36 36
            throw new IllegalArgumentException();
37 37
        }
38
        boolean is3D = subType == Geometry.SUBTYPES.GEOM3D || subType == Geometry.SUBTYPES.GEOM3DM;
39
        Line line = gManager.createLine(subType);
40
        for (double[] p : pts) {
41
            if( is3D ) {
42
                line.addVertex(p[0],p[1],p[2]);            
43
            } else {
44
                line.addVertex(p[0],p[1]);            
38
        try {
39
            boolean is3D = subType == Geometry.SUBTYPES.GEOM3D || subType == Geometry.SUBTYPES.GEOM3DM;
40
            Line line = gManager.createLine(subType);
41
            for (double[] p : pts) {
42
                if( is3D ) {
43
                    if( p.length<3 ) {
44
                        line.addVertex(p[0],p[1],0);            
45
                    } else {
46
                        line.addVertex(p[0],p[1],p[2]);            
47
                    }
48
                } else {
49
                    line.addVertex(p[0],p[1]);            
50
                }
45 51
            }
52
            return line;
53
        } catch(RuntimeException ex) {
54
            throw ex;
46 55
        }
47
        return line;
48 56
    }
49 57

  
50 58
    public static Surface ptsToPolygon(List<double[]> pts, int subType)

Also available in: Unified diff