summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/jsfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/jsfile.cc')
-rw-r--r--Build/source/utils/asymptote/jsfile.cc48
1 files changed, 46 insertions, 2 deletions
diff --git a/Build/source/utils/asymptote/jsfile.cc b/Build/source/utils/asymptote/jsfile.cc
index a46c15f4be8..93451b0f0da 100644
--- a/Build/source/utils/asymptote/jsfile.cc
+++ b/Build/source/utils/asymptote/jsfile.cc
@@ -232,8 +232,52 @@ void jsfile::addTriangles(size_t nP, const triple* P, size_t nN,
}
out << "P.push(new Triangles("
<< materialIndex << "," << newl
- << Min << "," << Max << "));" << newl;
- out << newl;
+ << Min << "," << Max << "));" << newl << newl;
+}
+
+void jsfile::addSphere(const triple& center, double radius, bool half,
+ const double& polar, const double& azimuth)
+{
+ out << "sphere(" << center << "," << radius << ","
+ << drawElement::centerIndex << "," << materialIndex;
+ if(half)
+ out << "," << newl << "[" << polar << "," << azimuth << "]";
+ out << ");" << newl << newl;
+}
+
+// core signifies whether to also draw a central line for better small-scale
+// rendering.
+void jsfile::addCylinder(const triple& center, double radius, double height,
+ const double& polar, const double& azimuth,
+ bool core)
+{
+ out << "cylinder(" << center << "," << radius << "," << height << ","
+ << drawElement::centerIndex << "," << materialIndex
+ << "," << newl << "[" << polar << "," << azimuth << "]," << core
+ << ");" << newl << newl;
+}
+
+void jsfile::addDisk(const triple& center, double radius,
+ const double& polar, const double& azimuth)
+{
+ out << "disk(" << center << "," << radius << ","
+ << drawElement::centerIndex << "," << materialIndex
+ << "," << newl << "[" << polar << "," << azimuth << "]"
+ << ");" << newl << newl;
+}
+
+void jsfile::addTube(const triple *g, double width,
+ const triple& Min, const triple& Max, bool core)
+
+{
+ out << "tube(["
+ << g[0] << "," << newl
+ << g[1] << "," << newl
+ << g[2] << "," << newl
+ << g[3] << newl << "],"
+ << width << ","
+ << drawElement::centerIndex << "," << materialIndex << ","
+ << Min << "," << Max << "," << core <<");" << newl << newl;
}
}