From 19d25b8009801aa98ea2f46b45c37c257f990491 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 4 Mar 2020 03:02:32 +0000 Subject: CTAN sync 202003040302 --- graphics/asymptote/jsfile.cc | 48 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'graphics/asymptote/jsfile.cc') 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; } } -- cgit v1.2.3