JavaCAD
Text3d.java
Go to the documentation of this file.
1 
34 package eu.mihosoft.vrl.v3d;
35 
36 import java.util.ArrayList;
37 import java.util.List;
38 
39 import javafx.scene.text.Font;
45 public class Text3d extends Primitive {
46 
48  ArrayList<CSG> letters;
54  public Text3d(String text) {
55  this(text, "Arial", 12, 1.0);
56  }
57 
64  public Text3d(String text, double depth) {
65  this(text, "Arial", 12, depth);
66  }
67 
76  public Text3d(String text, String fontName, double fontSize, double depth) {
77 
78  Font font = new Font(fontName, (int) fontSize);
79  letters = TextExtrude.text( depth, text, font);
80  for (int i=0;i<letters.size();i++){
81  letters.set(i, letters.get(i)
82  .rotx(180)
83  .toZMin()
84  );
85  }
86 
87 
88  }
89 
90  @Override
91  public List<Polygon> toPolygons() {
92  return letters.get(0).union(letters).getPolygons();
93  }
94 
95  @Override
97  return properties;
98  }
99 
100  public Text3d noCenter() {
101  return this;
102  }
103 
104 }
final PropertyStorage properties
Definition: Text3d.java:47
Text3d(String text, double depth)
Definition: Text3d.java:64
List< Polygon > toPolygons()
Definition: Text3d.java:91
PropertyStorage getProperties()
Definition: Text3d.java:96
Text3d(String text, String fontName, double fontSize, double depth)
Definition: Text3d.java:76