summaryrefslogtreecommitdiff
path: root/graphics/asymptote/jsfile.cc
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-03-04 03:02:32 +0000
committerNorbert Preining <norbert@preining.info>2020-03-04 03:02:32 +0000
commit19d25b8009801aa98ea2f46b45c37c257f990491 (patch)
treec0da70fbab26feff40e87df289ae797917df8419 /graphics/asymptote/jsfile.cc
parentb78f5a6705512314d6fe42fd5144c5f8e5d484ce (diff)
CTAN sync 202003040302
Diffstat (limited to 'graphics/asymptote/jsfile.cc')
-rw-r--r--graphics/asymptote/jsfile.cc48
1 files changed, 46 insertions, 2 deletions
diff --git a/graphics/asymptote/jsfile.cc b/graphics/asymptote/jsfile.cc
index a46c15f4be..93451b0f0d 100644
--- a/graphics/asymptote/jsfile.cc
+++ b/graphics/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;
}
}