![JAR search and dependency download from the Maven repository](/logo.png)
eu.mihosoft.vrl.v3d.svg.SVGExporter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JavaCad Show documentation
Show all versions of JavaCad Show documentation
A Java based CSG Cad library
package eu.mihosoft.vrl.v3d.svg;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import eu.mihosoft.vrl.v3d.CSG;
import eu.mihosoft.vrl.v3d.Polygon;
import eu.mihosoft.vrl.v3d.Slice;
import eu.mihosoft.vrl.v3d.Transform;
import eu.mihosoft.vrl.v3d.Vector3d;
import eu.mihosoft.vrl.v3d.Vertex;
@SuppressWarnings("restriction")
public class SVGExporter {
private String footer = "";
private String section = "";
//0.376975
//public static final double Scale = 3.543307;// SVG px to MM scale facto
private static final double Scale = 3.543307;
private static final double VueBoxSize = 100;
private int colorTicker=0;
public static List colorNames = Arrays.asList("crimson","gray","darkmagenta","darkolivegreen","darkgreen",
"darkblue",
"deeppink",
"chartreuse",
"green",
"orange",
"lime",
"black",
"tomato");
double min[] = { 0, 0 };
double max[] = { VueBoxSize, VueBoxSize };
private ArrayList polylines= new ArrayList<>() ;
private ArrayList groups= new ArrayList<>() ;
private ArrayList layers= new ArrayList<>() ;
private int layerCounter = 1;
private int groupCounter = 1;
private int lineCounter=0;
private String name="";
public SVGExporter(){
}
public String make(){
makeLayer();// make the final group
String output = "";
for(String s:layers){
output+=s+"\n";
}
double totalX = Math.abs(max[0]) + Math.abs(min[0]);
double totalY = Math.abs(max[1]) + Math.abs(min[1]);
double totalXmm = totalX/Scale;
double totalYmm = totalY/Scale;
String header = "\n"
+ "
© 2015 - 2025 Weber Informatics LLC | Privacy Policy