summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/jsfile.cc
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-03-03 22:35:09 +0000
committerKarl Berry <karl@freefriends.org>2020-03-03 22:35:09 +0000
commitf6bb2b5974c9dc15a4530842100d30fe1981b973 (patch)
tree62ef95efa54d91b6eafb6df99f330dc136f77f29 /Build/source/utils/asymptote/jsfile.cc
parent24dbc0b1802756862bedad6a4088f50aad68b51b (diff)
asy 2.63 sources
git-svn-id: svn://tug.org/texlive/trunk@54034 c570f23f-e606-0410-a88d-b1316a301751
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;
}
}