diff options
Diffstat (limited to 'graphics/asymptote')
97 files changed, 3477 insertions, 1828 deletions
diff --git a/graphics/asymptote/ChangeLog b/graphics/asymptote/ChangeLog index b27606df60..ba7cb8a609 100644 --- a/graphics/asymptote/ChangeLog +++ b/graphics/asymptote/ChangeLog @@ -1,3 +1,688 @@ +commit 94c770a177aae2dc11e19f70cc9f22ff649d7cea +Author: John Bowman <bowman@ualberta.ca> +Date: Sat Aug 6 22:17:24 2022 +0200 + + Update asygl. + +commit 9893d408fec128d76b50e3bef24ef6181beef0bc +Author: John Bowman <bowman@ualberta.ca> +Date: Sat Aug 6 22:12:33 2022 +0200 + + Use floating point WebGL colors. + +commit 89dac594687cd2892851a685c52a092e86db85a7 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat Aug 6 06:52:30 2022 +1000 + + Avoid global variables in AsyGL library. + +commit 0ab3eae561e21fcf5a906becf75483291db032d3 +Author: John Bowman <bowman@ualberta.ca> +Date: Wed Aug 3 22:14:33 2022 +0200 + + Preserve the terminal environment under MSDOS by ignoring the wait flag. + +commit 87f76fb7e5f3387643491fa123c18cf2be987006 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon Aug 1 23:36:30 2022 +0200 + + Enforce a unique normal and pen for each vertex in a PRC triangle group. + +commit 8e28af4e33a62630f82652552988c02267821578 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Jul 29 21:10:05 2022 +0200 + + Revert "Simplify code." + + This reverts commit 587a21490bf6d3892ddeab36dc8d8acdd3cec32c. + +commit 52170aac260c33ead0eddef60c527bcde782348c +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Jul 29 19:19:55 2022 +0200 + + Fix patch mode. + +commit b401886d804f4c5e870c69339c50dd76a97f0ea5 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Jul 29 19:08:18 2022 +0200 + + Revert "Simplify code." + + This reverts commit dc9d231185c9b01bd8d32c2bbbc87001caa1f4d8. + +commit c53b2c5fd4cc2d4bbf4afb071534786c09e70542 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Jul 29 12:53:45 2022 +0200 + + Fix segmentation fault. + +commit 0703107b953e0610a96776d059904af1cfb1c83e +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Jul 29 12:13:03 2022 +0200 + + Fix segmentation fault. + +commit 3433888b9a26fa85995617bfdc1e51137b198692 +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jul 28 05:55:22 2022 +1000 + + Fix defaultfilename for v3d files. + +commit 12740e6ff703bbab76629f065dd574f6242d130d +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jul 28 05:45:36 2022 +1000 + + Revert commented diagnostic. + +commit ec217a2261828eed41835da88c9bfa97af5ec2bc +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 26 20:47:12 2022 +0200 + + Move v3d specification back to GitHub now that LaTeX markdown is supported. + +commit cb6aeda7ff3c1ed42bb04ed45ba26ce5061797f1 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 26 15:18:10 2022 +0200 + + List ambiguous functions. + +commit 60df18eea453855571ee4a2cc3f45878a4fe52d9 +Merge: fa284421 4fe6f9fb +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 26 04:17:33 2022 -0600 + + Merge pull request #327 from jamadagni/master + + Additions to geometry.asy + +commit fa28442195bd99b9bac87e3ff752953ac57ee172 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 26 12:05:54 2022 +0200 + + Remove extraneous include. + +commit 3514430ddbdbf89e21b560202c06801c42ab590f +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 26 12:05:24 2022 +0200 + + Optimize dvisvgm output. + +commit a7588cad36589cc3df2b1bc66123e8c94b681a39 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 26 11:57:05 2022 +0200 + + Make dvisvgmMultipleFiles true by default. + +commit 8f18ae72e3f12db006aabb23a5045c149a9a821a +Author: John Bowman <bowman@ualberta.ca> +Date: Mon Jul 25 14:21:16 2022 -0600 + + Fix BUG #329: Fraction bars in labels are always black with PDF texengines. + +commit 4fe6f9fb1633ebcfff637bf2140f042b7d802245 +Author: Shriramana Sharma <samjnaa@gmail.com> +Date: Thu Jul 14 22:34:15 2022 +0530 + + add fill and filldraw for circle,ellipse,triangle,triangle[] + +commit 8b8ad63d73e25bc098840c61b16a869184a6cdb2 +Author: Shriramana Sharma <samjnaa@gmail.com> +Date: Thu Jul 14 20:19:38 2022 +0530 + + add path operator ecast(segment) + +commit 006cb4c48cae38fdd710a885df0d38fa172ed640 +Author: Shriramana Sharma <samjnaa@gmail.com> +Date: Thu Jul 14 19:57:20 2022 +0530 + + add path operator cast(triangle), fix points order + +commit dc9d231185c9b01bd8d32c2bbbc87001caa1f4d8 +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jul 14 09:22:08 2022 -0600 + + Simplify code. + +commit b7db8911e3b2cbcc3c6330312b49acb0e06213b9 +Author: Shriramana Sharma <samjnaa@gmail.com> +Date: Thu Jul 14 19:47:02 2022 +0530 + + rename geometry.orthocentercenter to geometry.orthocenter + +commit 587a21490bf6d3892ddeab36dc8d8acdd3cec32c +Author: John Bowman <bowman@ualberta.ca> +Date: Wed Jul 13 16:56:14 2022 -0600 + + Simplify code. + +commit 3961ec5be64d394e86e89d4ca30b176d4b5ecf62 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Jul 10 10:52:38 2022 -0600 + + Fix issue #320. + +commit 694902944ba06f3c77dad9bc0bcc4e465fa7e1d4 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat Jul 9 20:12:27 2022 -0600 + + Address issue #320. + +commit 33bf1141c1bb787bd5518dcfa9f73a4f48d37dfa +Author: John Bowman <bowman@ualberta.ca> +Date: Wed Jul 6 23:05:40 2022 -0600 + + Output mean color only for PRC. + +commit 7cbd28939b01da0f96980864698d7d704c9c1a9c +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 5 00:45:07 2022 -0600 + + Delete troublesome style file. + +commit 534d1361a7343dfc653a8b129d3392c0baba68f3 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 5 00:41:00 2022 -0600 + + Update asygl. + +commit 6cea12dfe927edec9aa784ab4b133f9b12ebde1d +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Jul 5 00:36:47 2022 -0600 + + WebGL: Support backwards compatibility. + +commit 323eb79327cf179491107d4ec3e3d6e994b324aa +Author: John Bowman <bowman@ualberta.ca> +Date: Mon Jul 4 23:56:02 2022 -0600 + + WebGL: Compute Bezier curve bounds. + +commit 482d04bdad8a25d274d1719f6653ff4d4c7b3250 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon Jul 4 17:05:47 2022 -0600 + + WEBGL: Compute triangle group bounds. + +commit 00cd7219a9794f21ecd3209411889b25523322e0 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon Jul 4 00:04:25 2022 -0600 + + WEBGL: Compute Bezier triangle bounds in WebGL. Remove Min and Max. + +commit 42bc4a3b4e0f187e265c353fc9e7766cf8165b95 +Merge: a45aaa1e 30ad132f +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Jul 3 22:09:06 2022 -0600 + + Merge branch 'master' into webglbounds. + +commit 30ad132f3a7dd182792d24a150aaa45de332ee8b +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Jul 3 19:34:37 2022 -0600 + + Simplify workflow. + +commit e15ba5b1e764cff6b75520d41c8fb96a03730d4e +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Jul 3 18:56:08 2022 -0600 + + Fix BUG #319: Rename NOCACHE to NoOutputFonts to address yet another Ghostscript backwards incompatibility (in Ghostscript version 9.56). + +commit 12a778be453f9319faeac99edfa25c0498bf2024 +Merge: d393a76b 48625bd2 +Author: John Bowman <bowman@ualberta.ca> +Date: Wed Jun 29 13:06:59 2022 -0600 + + Merge branch 'compute3'. + +commit 48625bd2b66ca904af42e308c5bf8d0b5571de39 +Author: John Bowman <bowman@ualberta.ca> +Date: Wed Jun 29 13:03:58 2022 -0600 + + Fix typo. + +commit d393a76b3960455b4285806771e705faa54c20d8 +Merge: 0669e4fb d8cacc97 +Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com> +Date: Tue Jun 21 15:44:12 2022 -0600 + + Merge pull request #317 from vectorgraphics/dependabot/pip/GUI/numpy-1.22.0 + + Bump numpy from 1.21.0 to 1.22.0 in /GUI + +commit d8cacc97b70f35914ba89baf8c564af93af42edc +Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> +Date: Tue Jun 21 21:32:47 2022 +0000 + + Bump numpy from 1.21.0 to 1.22.0 in /GUI + + Bumps [numpy](https://github.com/numpy/numpy) from 1.21.0 to 1.22.0. + - [Release notes](https://github.com/numpy/numpy/releases) + - [Changelog](https://github.com/numpy/numpy/blob/main/doc/HOWTO_RELEASE.rst) + - [Commits](https://github.com/numpy/numpy/compare/v1.21.0...v1.22.0) + + --- + updated-dependencies: + - dependency-name: numpy + dependency-type: direct:production + ... + + Signed-off-by: dependabot[bot] <support@github.com> + +commit 8677a0f1a2571f1b38fc1589cf12f6341f69b659 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Jun 12 10:32:22 2022 -0600 + + TRANSPARENCY: Save 4 bytes in shuffle array. + +commit a45aaa1e948343e6a6d86391f26f4f132e17e6bd +Merge: 5f676ec6 0669e4fb +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jun 9 19:01:27 2022 -0600 + + Merge branch 'master' into webglbounds. + +commit 0669e4fb0fc358ae9555d3db375f3568365b740b +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jun 9 19:00:57 2022 -0600 + + Compute tight bounds of Bezier patches and triangles. + +commit 5f676ec6a4cc13ce7e382f8b5204df700e97e2b4 +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jun 9 17:35:45 2022 -0600 + + Compute Bezier patch bounds in WebGL. + +commit 4f51b82701aea7a9c14b89aa833fa10152f2d8c1 +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jun 9 17:26:50 2022 -0600 + + Fix formatting. + +commit 2879110f7a1ebb3c03cfbb01d68bfc4edbce466a +Author: John Bowman <bowman@ualberta.ca> +Date: Mon Jun 6 21:45:14 2022 -0600 + + Derive size from offset in blend shader. + +commit 597d08b0ae468babf8c9a7b956d14c11415c1946 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Jun 5 13:06:39 2022 -0600 + + Update to latest prefixsum shader. + +commit 75baa00f90034b6de5ccb2dc57b10d723effb4e3 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat Jun 4 21:02:02 2022 -0600 + + Restore zero shader. + +commit a95c328913df1d0b6ec0ecdb89dae48577556525 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Jun 3 00:45:00 2022 -0600 + + Automatically choose optimal sum2 shader. + +commit ba6fcdce8f4e90da7944a9ddec6fbd0ab617181e +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jun 2 16:05:07 2022 -0600 + + Optimize sum shaders. + +commit 5db78fbb79c6711d250748e47a08381eff4f9a04 +Author: John Bowman <bowman@ualberta.ca> +Date: Thu Jun 2 09:26:49 2022 -0600 + + Generalize sum2 shader. + +commit 70a7c559bbac4e1939552b4228704bdf60a753df +Author: John Bowman <bowman@ualberta.ca> +Date: Wed Jun 1 16:10:04 2022 -0600 + + Use optimized binomial tree reduce in sum1 shader. + +commit 9b853eead5d61728663ed5c457b4764800a70f17 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 31 13:33:33 2022 -0600 + + Optimize sum1 shader. + +commit aa4700c2d91fcd17fd1768bd7df45ccd788c20d7 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 31 11:58:45 2022 -0600 + + Revert cd7092db3a5f297df6b735c91b4989caf8e60609. + +commit be2310a8affc0abf3e8d330489e2ff1f491c3df9 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 31 11:20:20 2022 -0600 + + Fix memory barriers. + +commit 7df45601fd0e38a252e4c68929ed54d9c286e971 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 31 10:45:45 2022 -0600 + + Fix memory barriers; optimize Hillis-Steele algorithm. + +commit 64ca0f99828ac592896b524aa79b043101210e24 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 30 23:05:02 2022 -0600 + + Add missing shader. + +commit 411ffcbc0b0cf626a36ab66bb342656a1e1da2e4 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 30 19:00:48 2022 -0600 + + Finish partial sums. + +commit 8519ee922db934d05f0945b93ef17e4b24fe6ea2 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 30 10:58:37 2022 -0600 + + Implement bezier(real a, real b, real c, real d, real t). + +commit a728266f13a123f772294b50e2a58b50c28091ef +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 23:24:34 2022 -0600 + + Avoid unnecessary differential computations. + +commit c5ff5bd2628c05dcf52acd6502a851d78cce3510 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 23:18:15 2022 -0600 + + Defer fragment buffer resizing as long as possible. + +commit 952e340b05bbd3b6ad5f191f74e0669a5055c2ac +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 23:06:37 2022 -0600 + + Fix noGPUindexing. + +commit 044dc63915cb19f8106f2e8ebb5df91cf15cdf4f +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 22:59:22 2022 -0600 + + Disable subdivision crack adjustments for transparent patches. + +commit 8bd698940d42574cbe6c7a3c7170039157b43196 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 22:46:26 2022 -0600 + + Fix commit f57b4f8b9ead42f092cb706960bf10b6b8d55e30. + +commit 8931b432b64b6b90e934bc502c62fffe47a4a8cb +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 22:11:32 2022 -0600 + + Standardize names. + +commit bf9e1ee6c40f9de385992ecef5ca0b8c46f3f63b +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 21:55:36 2022 -0600 + + Improve performance. + +commit 77d25cd8a9151b5a32ecb6169b5973284a28a955 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 19:13:12 2022 -0600 + + Fix maximum depth detection. + +commit cd7092db3a5f297df6b735c91b4989caf8e60609 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 15:49:18 2022 -0600 + + Use atomicCounterExchange to reset compression counter. + +commit e407a7c34129589fcbb0a86d42925592e7d3f8b0 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 14:42:47 2022 -0600 + + Finish implementing feedback to CPU. + +commit f57b4f8b9ead42f092cb706960bf10b6b8d55e30 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 10:51:02 2022 -0600 + + Send feedback to CPU. + +commit 5801785e5729fda77f88fabdd7ddbd0e53a48851 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 00:57:57 2022 -0600 + + Revert "Store opaqueDepth in alpha channel of opaqueColor." + + This reverts commit 431d19384d090f11daeed3dc449dc61d2ed5e309. + +commit 431d19384d090f11daeed3dc449dc61d2ed5e309 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun May 29 00:04:35 2022 -0600 + + Store opaqueDepth in alpha channel of opaqueColor. + +commit a35d30b911d256832fe067f638aec75fdad79814 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat May 28 23:28:28 2022 -0600 + + Test 2-stage algorithm. + +commit 64942510ac5d30470cdd22e777cd0b1a38a6ff69 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat May 28 23:00:33 2022 -0600 + + Test 3-stage algorithm. + +commit e84bf41ae59bb60cdff9357fc0c7f7faf8933174 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat May 28 11:19:37 2022 -0600 + + Add const qualifier. + +commit 0f0a04b64cccd21c656ec7a69565f43cf8e6a7b7 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri May 27 23:26:36 2022 -0600 + + Implement GPUblockSize. + +commit 58ddb9f87dcee756366d82b48424c3fe1bac19d9 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri May 27 23:02:11 2022 -0600 + + Disable GPUcompression by default. + +commit 7dae0ee579ba48d52d4687b79e87506e989a8ce2 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri May 27 22:48:47 2022 -0600 + + Use a single improved shader to avoid bank conflicts. + +commit 4712edd628e9742417b7d83b4d38d2721bae370e +Author: John Bowman <bowman@ualberta.ca> +Date: Wed May 25 09:32:56 2022 -0600 + + Simplify code. + +commit 1bfbb8215540524f4182744d836031d2223915ed +Author: John Bowman <bowman@ualberta.ca> +Date: Wed May 25 09:27:17 2022 -0600 + + Revert "Perform all sums on the GPU." + + This reverts commit 574eb027cf53064cfb27e8ab09333a7775b2e094. + +commit 574eb027cf53064cfb27e8ab09333a7775b2e094 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 23 22:59:08 2022 -0600 + + Perform all sums on the GPU. + +commit d270aa2012843aa592d2ada3b390ded7c1c3c35f +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 23 19:28:39 2022 -0600 + + Implement Hillis-Steele algorithm in second stage. + +commit b182742a8ac29f1fbf1f37228492a09236c0e0ce +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 23 17:35:04 2022 -0600 + + Add another compute shader stage to reduce bandwidth to CPU. + +commit 85e78f59600fde0f6214212012c80ff539474a13 +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 23 16:10:44 2022 -0600 + + Avoid use of localSumBuffer. + +commit 4d4159b5ec2eafa2bb3ba0837d863690af66ce4e +Author: John Bowman <bowman@ualberta.ca> +Date: Mon May 23 15:30:10 2022 -0600 + + Use a single compute shader. + +commit 13aa6344ac37b2303deb1e4e6d6a24d9b260762f +Author: John Bowman <bowman@ualberta.ca> +Date: Thu May 19 20:57:45 2022 -0600 + + Improve documentation of rotate(real, triple). + +commit c1ec3a89279d567cf4a910557546137aac2c0ee3 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat May 14 12:27:51 2022 -0600 + + Increment version to 2.82. + +commit 920c0886c23e20db270d04337e59c4d9e069dc63 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri May 13 23:17:54 2022 -0600 + + Fix CYGWIN warning. + +commit c895e09915302ae276740f1cc91afd834658ae37 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri May 13 22:31:19 2022 -0600 + + Fix bug #313: opaque rendering on platforms lacking GL_ARB_fragment_shader_interlock. + +commit fc7dac6887136289035eaa4f7f60fcbee1dc3967 +Author: John Bowman <bowman@ualberta.ca> +Date: Wed May 11 18:29:56 2022 -0600 + + Update documentation. + +commit d54736762baaf6b675311c0e5791f6aa5792ae57 +Author: John Bowman <bowman@ualberta.ca> +Date: Wed May 11 16:40:43 2022 -0600 + + Document surface constructor for solids of revolution. + +commit f910ea19eee9f240045594bf049f363cc8181ac4 +Merge: de70a958 72b0fe36 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 10 22:20:00 2022 -0600 + + Merge branch 'Qt'. + +commit de70a958b3844210142a9066b20bfce2a62bde4f +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 10 21:38:21 2022 -0600 + + Zero offset buffer when required. + +commit 72b0fe3685729e059337082dcd5585ae7fa20f50 +Author: chaumont-arch <chaumont@ualberta.ca> +Date: Sun May 8 22:38:36 2022 -0600 + + XASY: Fix crashes from opening xasy files. + +commit a14f4a75cd8f6d0f9cf6c4217e70baa690e4a1ad +Author: chaumont-arch <chaumont@ualberta.ca> +Date: Thu May 5 23:11:47 2022 -0600 + + XASY: Fix bounding box drawing issue. + +commit 27d52fa7a6356cda473eb24acac77e822c6fb09d +Author: John Bowman <bowman@ualberta.ca> +Date: Tue May 3 12:20:43 2022 -0600 + + Port to MacOS. + +commit e23a5527b710aa3cbf83d1d0a682aa5c6a49b62c +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Apr 24 10:24:46 2022 -0600 + + Fix bug #310: Missing slash in temporary file path. + +commit 365df5651ce0728fa3607d05ae1396668f374197 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Apr 10 09:35:38 2022 -0600 + + Rename example. + +commit 253349484d7d76aeb639428f02e5c08779fbe094 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Apr 10 00:31:20 2022 -0600 + + Add missing typedef. + +commit 29967ac62cb69bf3e3196b8cdf5e714007eabce2 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Apr 10 00:20:20 2022 -0600 + + Fix last commit. + +commit 6f10abaa6611c52cb8040b5715218287202b5510 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Apr 10 00:18:32 2022 -0600 + + Consult pkg-config for readline library. + +commit 5af8022000bd9d3ab21e7c3548e92e9d59dd3c07 +Author: John Bowman <bowman@ualberta.ca> +Date: Sun Apr 10 00:11:15 2022 -0600 + + Fix issue #40: Consult pkg-config. + +commit 4bd54e14498523c06a2e4cecf20e7c4c6851299d +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Apr 8 23:23:37 2022 -0600 + + Fix issue #309. + +commit 2ffee49a7e3fe5180a96332d529eae8bfe7a8316 +Author: John Bowman <bowman@ualberta.ca> +Date: Sat Apr 9 14:49:43 2022 +1000 + + Move global typedef within namespace. + +commit 8f2ce216a6f5537d74a6b691fcd416a344570007 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Apr 8 17:03:24 2022 -0600 + + Implement real Schur decomposition. + +commit 0f2ad99bcd3b7cb85ba66d4576ada8438da9c288 +Author: John Bowman <bowman@ualberta.ca> +Date: Fri Apr 8 16:23:26 2022 -0600 + + Implement Schur decomposition. + +commit 5b705e7dece21fb809a43e25b4e97c1707a21152 +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Apr 5 23:28:53 2022 -0600 + + Add example; remove empty directories. + +commit b00f9fc3c2bf1b3b3cb311faf7098c149088e3cb +Author: John Bowman <bowman@ualberta.ca> +Date: Tue Apr 5 21:48:56 2022 -0600 + + Increment version to 2.81. + commit 52f5c99018d24883f6e115ae72beaa88a15d0669 Author: John Bowman <bowman@ualberta.ca> Date: Tue Apr 5 11:32:10 2022 -0600 diff --git a/graphics/asymptote/GUI/Window1.py b/graphics/asymptote/GUI/Window1.py index 134d3cd196..3da918ff6c 100644 --- a/graphics/asymptote/GUI/Window1.py +++ b/graphics/asymptote/GUI/Window1.py @@ -1060,9 +1060,10 @@ class MainWindow1(Qw.QMainWindow): for item in xasyObjects['objects']: key=item['transfKey'] - if(key) in obj.transfKeymap.keys(): - continue - obj.maxKey=max(obj.maxKey,int(key)) + if existsAsy: + if(key) in obj.transfKeymap.keys(): + continue + obj.maxKey=max(obj.maxKey,int(key)) if item['type'] == 'xasyScript': print("Uh oh, there should not be any asy objects loaded") @@ -1083,7 +1084,8 @@ class MainWindow1(Qw.QMainWindow): print("ERROR") self.asy2psmap = x2a.asyTransform(xasyObjects['asy2psmap']) - self.globalObjectCounter = obj.maxKey+1 + if existsAsy: + self.globalObjectCounter = obj.maxKey+1 self.asyfyCanvas() @@ -2046,7 +2048,7 @@ class MainWindow1(Qw.QMainWindow): with Qg.QPainter(self.postCanvasPixmap) as postCanvas: postCanvas.setRenderHints(self.mainCanvas.renderHints()) postCanvas.setTransform(self.getScrsTransform()) - # self.makePenCosmetic(postCanvas) + self.makePenCosmetic(postCanvas) self.drawTransformPreview(postCanvas) diff --git a/graphics/asymptote/GUI/requirements.txt b/graphics/asymptote/GUI/requirements.txt index b319223a3c..6e0a44196a 100644 --- a/graphics/asymptote/GUI/requirements.txt +++ b/graphics/asymptote/GUI/requirements.txt @@ -1,4 +1,4 @@ -numpy==1.21.0 +numpy==1.22.0 cson==0.7 PyQt5==5.11 rsvg-convert==2.42.3 diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake index 11f101c700..51cd33465d 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake +++ b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake @@ -2,8 +2,8 @@ # Generated by "Unix Makefiles" Generator, CMake Version 3.22 # Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/src/asymptote-2.80/LspCpp") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/local/src/asymptote-2.80/LspCpp") +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/src/asymptote-2.82/LspCpp") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/local/src/asymptote-2.82/LspCpp") # Force unix paths in dependencies. set(CMAKE_FORCE_UNIX_PATHS 1) diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make index 8dde621948..68cd85974d 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make +++ b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make @@ -56,10 +56,10 @@ RM = /usr/bin/cmake -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.82/LspCpp # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.82/LspCpp # Utility rule file for doc. @@ -70,8 +70,8 @@ include third_party/uri/CMakeFiles/doc.dir/compiler_depend.make include third_party/uri/CMakeFiles/doc.dir/progress.make third_party/uri/CMakeFiles/doc: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Generating API documentation with Doxygen" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri && /bin/doxygen /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/Doxyfile + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Generating API documentation with Doxygen" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri && /bin/doxygen /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/Doxyfile doc: third_party/uri/CMakeFiles/doc doc: third_party/uri/CMakeFiles/doc.dir/build.make @@ -82,10 +82,10 @@ third_party/uri/CMakeFiles/doc.dir/build: doc .PHONY : third_party/uri/CMakeFiles/doc.dir/build third_party/uri/CMakeFiles/doc.dir/clean: - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri && $(CMAKE_COMMAND) -P CMakeFiles/doc.dir/cmake_clean.cmake + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri && $(CMAKE_COMMAND) -P CMakeFiles/doc.dir/cmake_clean.cmake .PHONY : third_party/uri/CMakeFiles/doc.dir/clean third_party/uri/CMakeFiles/doc.dir/depend: - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/src/asymptote-2.80/LspCpp /usr/local/src/asymptote-2.80/LspCpp/third_party/uri /usr/local/src/asymptote-2.80/LspCpp /usr/local/src/asymptote-2.80/LspCpp/third_party/uri /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake --color=$(COLOR) + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/src/asymptote-2.82/LspCpp /usr/local/src/asymptote-2.82/LspCpp/third_party/uri /usr/local/src/asymptote-2.82/LspCpp /usr/local/src/asymptote-2.82/LspCpp/third_party/uri /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake --color=$(COLOR) .PHONY : third_party/uri/CMakeFiles/doc.dir/depend diff --git a/graphics/asymptote/LspCpp/third_party/uri/Doxyfile b/graphics/asymptote/LspCpp/third_party/uri/Doxyfile index 27a544f618..cd61995ea9 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/Doxyfile +++ b/graphics/asymptote/LspCpp/third_party/uri/Doxyfile @@ -128,7 +128,7 @@ FULL_PATH_NAMES = YES # If left blank the directory from which doxygen is run is used as the # path to strip. -STRIP_FROM_PATH = /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/ +STRIP_FROM_PATH = /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/ # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells @@ -626,7 +626,7 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include +INPUT = /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -658,7 +658,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail +EXCLUDE = /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -821,7 +821,7 @@ COLS_IN_ALPHA_INDEX = 5 # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. -IGNORE_PREFIX = /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/uri/src/ +IGNORE_PREFIX = /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/uri/src/ #--------------------------------------------------------------------------- # configuration options related to the HTML output diff --git a/graphics/asymptote/LspCpp/third_party/uri/Makefile b/graphics/asymptote/LspCpp/third_party/uri/Makefile index dde375604f..86b0d21ac4 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/Makefile +++ b/graphics/asymptote/LspCpp/third_party/uri/Makefile @@ -60,10 +60,10 @@ RM = /usr/bin/cmake -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.82/LspCpp # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.82/LspCpp #============================================================================= # Targets provided globally by CMake. @@ -135,14 +135,14 @@ install/strip/fast: preinstall/fast # The main all target all: cmake_check_build_system - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.80/LspCpp/CMakeFiles /usr/local/src/asymptote-2.80/LspCpp/third_party/uri//CMakeFiles/progress.marks - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/all - $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.80/LspCpp/CMakeFiles 0 + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.82/LspCpp/CMakeFiles /usr/local/src/asymptote-2.82/LspCpp/third_party/uri//CMakeFiles/progress.marks + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/all + $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.82/LspCpp/CMakeFiles 0 .PHONY : all # The main clean target clean: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/clean + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/clean .PHONY : clean # The main clean target @@ -151,22 +151,22 @@ clean/fast: clean # Prepare targets for installation. preinstall: all - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/preinstall + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/preinstall .PHONY : preinstall # Prepare targets for installation. preinstall/fast: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/preinstall + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/preinstall .PHONY : preinstall/fast # clear depends depend: - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 .PHONY : depend # Convenience name for target. third_party/uri/CMakeFiles/doc.dir/rule: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/CMakeFiles/doc.dir/rule + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/CMakeFiles/doc.dir/rule .PHONY : third_party/uri/CMakeFiles/doc.dir/rule # Convenience name for target. @@ -175,7 +175,7 @@ doc: third_party/uri/CMakeFiles/doc.dir/rule # fast build rule for target. doc/fast: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/CMakeFiles/doc.dir/build.make third_party/uri/CMakeFiles/doc.dir/build + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/CMakeFiles/doc.dir/build.make third_party/uri/CMakeFiles/doc.dir/build .PHONY : doc/fast # Help Target @@ -202,6 +202,6 @@ help: # No rule that depends on this can have commands that come from listfiles # because they might be regenerated. cmake_check_build_system: - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 .PHONY : cmake_check_build_system diff --git a/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake b/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake index d656f1a2ea..22997663f4 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake +++ b/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake @@ -1,4 +1,4 @@ -# Install script for directory: /usr/local/src/asymptote-2.80/LspCpp/third_party/uri +# Install script for directory: /usr/local/src/asymptote-2.82/LspCpp/third_party/uri # Set the install prefix if(NOT DEFINED CMAKE_INSTALL_PREFIX) @@ -43,12 +43,12 @@ if(NOT DEFINED CMAKE_OBJDUMP) endif() if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/." TYPE DIRECTORY FILES "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include") + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/." TYPE DIRECTORY FILES "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include") endif() if(NOT CMAKE_INSTALL_LOCAL_ONLY) # Include the install script for each subdirectory. - include("/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/cmake_install.cmake") + include("/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/cmake_install.cmake") endif() diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/assets/css/style.scss b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/assets/css/style.scss deleted file mode 100644 index bb30f418da..0000000000 --- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/assets/css/style.scss +++ /dev/null @@ -1,5 +0,0 @@ ---- ---- - -@import "jekyll-theme-primer"; -@import "main"; diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake index 11f101c700..51cd33465d 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake +++ b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake @@ -2,8 +2,8 @@ # Generated by "Unix Makefiles" Generator, CMake Version 3.22 # Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/src/asymptote-2.80/LspCpp") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/local/src/asymptote-2.80/LspCpp") +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/src/asymptote-2.82/LspCpp") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/local/src/asymptote-2.82/LspCpp") # Force unix paths in dependencies. set(CMAKE_FORCE_UNIX_PATHS 1) diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake index a8b5372c91..75668a664f 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake +++ b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake @@ -8,14 +8,14 @@ set(CMAKE_DEPENDS_LANGUAGES # The set of dependency files which are needed: set(CMAKE_DEPENDS_DEPENDENCY_FILES - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_builder.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o.d" - "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_errors.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_builder.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o.d" + "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_errors.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o.d" ) # Targets to which this target links. diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make index 721c2f3e07..cf80107ca1 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make +++ b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make @@ -56,10 +56,10 @@ RM = /usr/bin/cmake -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.82/LspCpp # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.82/LspCpp # Include any dependencies generated for this target. include third_party/uri/src/CMakeFiles/network-uri.dir/depend.make @@ -75,114 +75,114 @@ include third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/uri.cpp third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o -MF CMakeFiles/network-uri.dir/uri.cpp.o.d -o CMakeFiles/network-uri.dir/uri.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o -MF CMakeFiles/network-uri.dir/uri.cpp.o.d -o CMakeFiles/network-uri.dir/uri.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri.cpp third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/uri.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri.cpp > CMakeFiles/network-uri.dir/uri.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri.cpp > CMakeFiles/network-uri.dir/uri.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/uri.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri.cpp -o CMakeFiles/network-uri.dir/uri.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri.cpp -o CMakeFiles/network-uri.dir/uri.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/uri_builder.cpp third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o -MF CMakeFiles/network-uri.dir/uri_builder.cpp.o.d -o CMakeFiles/network-uri.dir/uri_builder.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_builder.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o -MF CMakeFiles/network-uri.dir/uri_builder.cpp.o.d -o CMakeFiles/network-uri.dir/uri_builder.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_builder.cpp third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/uri_builder.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_builder.cpp > CMakeFiles/network-uri.dir/uri_builder.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_builder.cpp > CMakeFiles/network-uri.dir/uri_builder.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/uri_builder.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_builder.cpp -o CMakeFiles/network-uri.dir/uri_builder.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_builder.cpp -o CMakeFiles/network-uri.dir/uri_builder.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/uri_errors.cpp third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o -MF CMakeFiles/network-uri.dir/uri_errors.cpp.o.d -o CMakeFiles/network-uri.dir/uri_errors.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_errors.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o -MF CMakeFiles/network-uri.dir/uri_errors.cpp.o.d -o CMakeFiles/network-uri.dir/uri_errors.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_errors.cpp third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/uri_errors.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_errors.cpp > CMakeFiles/network-uri.dir/uri_errors.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_errors.cpp > CMakeFiles/network-uri.dir/uri_errors.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/uri_errors.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_errors.cpp -o CMakeFiles/network-uri.dir/uri_errors.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_errors.cpp -o CMakeFiles/network-uri.dir/uri_errors.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/detail/uri_parse.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.cpp > CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.cpp > CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.cpp -o CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.cpp -o CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/detail/uri_parse_authority.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp > CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp > CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp -o CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp -o CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/detail/uri_advance_parts.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp > CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp > CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp -o CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp -o CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/detail/uri_normalize.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.cpp > CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.cpp > CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.cpp -o CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.cpp -o CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/detail/uri_resolve.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o -c /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.cpp + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o -c /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.cpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.cpp > CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.cpp > CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s: cmake_force @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.cpp -o CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.cpp -o CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s # Object files for target network-uri network__uri_OBJECTS = \ @@ -208,19 +208,19 @@ third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/usr/local/src/asymptote-2.80/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Linking CXX static library libnetwork-uri.a" - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -P CMakeFiles/network-uri.dir/cmake_clean_target.cmake - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/network-uri.dir/link.txt --verbose=$(VERBOSE) + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/usr/local/src/asymptote-2.82/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Linking CXX static library libnetwork-uri.a" + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -P CMakeFiles/network-uri.dir/cmake_clean_target.cmake + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/network-uri.dir/link.txt --verbose=$(VERBOSE) # Rule to build all files generated by this target. third_party/uri/src/CMakeFiles/network-uri.dir/build: third_party/uri/src/libnetwork-uri.a .PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/build third_party/uri/src/CMakeFiles/network-uri.dir/clean: - cd /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -P CMakeFiles/network-uri.dir/cmake_clean.cmake + cd /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -P CMakeFiles/network-uri.dir/cmake_clean.cmake .PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/clean third_party/uri/src/CMakeFiles/network-uri.dir/depend: - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/src/asymptote-2.80/LspCpp /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src /usr/local/src/asymptote-2.80/LspCpp /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake --color=$(COLOR) + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/src/asymptote-2.82/LspCpp /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src /usr/local/src/asymptote-2.82/LspCpp /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake --color=$(COLOR) .PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/depend diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal index cbae0e9b8d..c777aff35a 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal +++ b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal @@ -2,10 +2,10 @@ # Generated by "Unix Makefiles" Generator, CMake Version 3.22 third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp /usr/include/stdc-predef.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp /usr/include/c++/11/string /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h /usr/include/bits/wordsize.h @@ -171,7 +171,7 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o /usr/include/c++/11/typeinfo /usr/include/c++/11/bits/nested_exception.h /usr/include/c++/11/bits/streambuf.tcc - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp /usr/include/c++/11/memory /usr/include/c++/11/bits/stl_uninitialized.h /usr/include/c++/11/bits/stl_tempbuf.h @@ -198,16 +198,16 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o /usr/include/c++/11/bits/algorithmfwd.h /usr/include/c++/11/bits/stl_heap.h /usr/include/c++/11/bits/uniform_int_dist.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp /usr/include/c++/11/cassert /usr/include/assert.h /usr/include/c++/11/limits third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.cpp /usr/include/stdc-predef.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri.hpp /usr/include/c++/11/iterator /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h /usr/include/bits/wordsize.h @@ -401,21 +401,21 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o /usr/include/c++/11/bits/atomic_base.h /usr/include/c++/11/bits/atomic_lockfree_defines.h /usr/include/c++/11/backward/auto_ptr.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp /usr/include/c++/11/cassert /usr/include/assert.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/config.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/config.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp /usr/include/c++/11/cstring /usr/include/string.h /usr/include/strings.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp /usr/include/c++/11/vector /usr/include/c++/11/bits/stl_vector.h /usr/include/c++/11/bits/stl_bvector.h @@ -436,14 +436,14 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o /usr/include/c++/11/bits/codecvt.h /usr/include/c++/11/bits/locale_facets_nonio.tcc /usr/include/c++/11/bits/locale_conv.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/algorithm.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/algorithm_split.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/algorithm.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/algorithm_split.hpp third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.cpp /usr/include/stdc-predef.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp /usr/include/c++/11/string /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h /usr/include/bits/wordsize.h @@ -618,7 +618,7 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o /usr/include/c++/11/bits/stl_tempbuf.h /usr/include/c++/11/bits/uniform_int_dist.h /usr/include/c++/11/limits - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/grammar.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/grammar.hpp /usr/include/c++/11/locale /usr/include/c++/11/bits/locale_facets.h /usr/include/c++/11/cwctype @@ -643,8 +643,8 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o /usr/include/c++/11/cstring /usr/include/string.h /usr/include/strings.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp /usr/include/c++/11/memory /usr/include/c++/11/bits/stl_uninitialized.h /usr/include/c++/11/bits/stl_raw_storage_iter.h @@ -662,10 +662,10 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o /usr/include/c++/11/backward/auto_ptr.h third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp /usr/include/stdc-predef.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp /usr/include/c++/11/string /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h /usr/include/bits/wordsize.h @@ -831,7 +831,7 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o /usr/include/c++/11/typeinfo /usr/include/c++/11/bits/nested_exception.h /usr/include/c++/11/bits/streambuf.tcc - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp /usr/include/c++/11/memory /usr/include/c++/11/bits/stl_uninitialized.h /usr/include/c++/11/bits/stl_tempbuf.h @@ -858,11 +858,11 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o /usr/include/c++/11/bits/algorithmfwd.h /usr/include/c++/11/bits/stl_heap.h /usr/include/c++/11/bits/uniform_int_dist.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp /usr/include/c++/11/cassert /usr/include/assert.h /usr/include/c++/11/limits - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/grammar.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/grammar.hpp /usr/include/c++/11/locale /usr/include/c++/11/bits/locale_facets.h /usr/include/c++/11/cwctype @@ -884,10 +884,10 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o /usr/include/strings.h third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.cpp /usr/include/stdc-predef.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri.hpp /usr/include/c++/11/iterator /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h /usr/include/bits/wordsize.h @@ -1081,25 +1081,25 @@ third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o /usr/include/c++/11/bits/atomic_base.h /usr/include/c++/11/bits/atomic_lockfree_defines.h /usr/include/c++/11/backward/auto_ptr.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp /usr/include/c++/11/cassert /usr/include/assert.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/config.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/config.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp /usr/include/c++/11/cstring /usr/include/string.h /usr/include/strings.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/algorithm_find.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/algorithm_find.hpp /usr/include/c++/11/cstddef third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri.cpp /usr/include/stdc-predef.h /usr/include/c++/11/cassert /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h @@ -1296,7 +1296,7 @@ third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o /usr/include/c++/11/functional /usr/include/c++/11/bits/refwrap.h /usr/include/c++/11/bits/std_function.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri.hpp /usr/include/c++/11/iterator /usr/include/c++/11/bits/stream_iterator.h /usr/include/c++/11/memory @@ -1313,31 +1313,31 @@ third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o /usr/include/c++/11/bits/atomic_base.h /usr/include/c++/11/bits/atomic_lockfree_defines.h /usr/include/c++/11/backward/auto_ptr.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/config.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/config.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp /usr/include/c++/11/cstring /usr/include/string.h /usr/include/strings.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp /usr/include/c++/11/vector /usr/include/c++/11/bits/stl_vector.h /usr/include/c++/11/bits/stl_bvector.h /usr/include/c++/11/bits/vector.tcc - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_resolve.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/algorithm.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_resolve.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/algorithm.hpp third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_builder.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_builder.cpp /usr/include/stdc-predef.h /usr/include/c++/11/locale /usr/include/c++/11/bits/localefwd.h @@ -1523,8 +1523,8 @@ third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o /usr/include/c++/11/array /usr/include/c++/11/bits/uses_allocator.h /usr/include/c++/11/bits/invoke.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri.hpp /usr/include/c++/11/iterator /usr/include/c++/11/bits/stream_iterator.h /usr/include/c++/11/algorithm @@ -1550,25 +1550,25 @@ third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o /usr/include/c++/11/bits/atomic_base.h /usr/include/c++/11/bits/atomic_lockfree_defines.h /usr/include/c++/11/backward/auto_ptr.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/string_view.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/string_view.hpp /usr/include/c++/11/cassert /usr/include/assert.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/optional.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/config.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/optional.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/config.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp /usr/include/c++/11/cstring /usr/include/string.h /usr/include/strings.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_normalize.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/detail/algorithm.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_normalize.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/detail/algorithm.hpp third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/uri_errors.cpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/uri_errors.cpp /usr/include/stdc-predef.h /usr/include/c++/11/string /usr/include/c++/11/x86_64-redhat-linux/bits/c++config.h @@ -1717,7 +1717,7 @@ third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o /usr/include/c++/11/bits/functional_hash.h /usr/include/c++/11/bits/hash_bytes.h /usr/include/c++/11/bits/basic_string.tcc - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp /usr/include/c++/11/system_error /usr/include/c++/11/x86_64-redhat-linux/bits/error_constants.h /usr/include/c++/11/stdexcept @@ -1726,5 +1726,5 @@ third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o /usr/include/c++/11/bits/cxxabi_init_exception.h /usr/include/c++/11/typeinfo /usr/include/c++/11/bits/nested_exception.h - /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include/network/uri/config.hpp + /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include/network/uri/config.hpp diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make index 0f19377248..001b66741d 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make +++ b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make @@ -4,7 +4,7 @@ # compile CXX with /bin/c++ CXX_DEFINES = -CXX_INCLUDES = -I/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src -I/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/include +CXX_INCLUDES = -I/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src -I/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/include CXX_FLAGS = -fPIE -D_FILE_OFFSET_BITS=64 -DUSEGC -I../gc-8.2.0/include -std=c++11 -Wall -Werror -Wno-parentheses -O2 -g -DNDEBUG diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/Makefile b/graphics/asymptote/LspCpp/third_party/uri/src/Makefile index e4b5c4c937..fca7499fb8 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/Makefile +++ b/graphics/asymptote/LspCpp/third_party/uri/src/Makefile @@ -60,10 +60,10 @@ RM = /usr/bin/cmake -E rm -f EQUALS = = # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.82/LspCpp # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.80/LspCpp +CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.82/LspCpp #============================================================================= # Targets provided globally by CMake. @@ -135,14 +135,14 @@ install/strip/fast: preinstall/fast # The main all target all: cmake_check_build_system - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.80/LspCpp/CMakeFiles /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src//CMakeFiles/progress.marks - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/all - $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.80/LspCpp/CMakeFiles 0 + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.82/LspCpp/CMakeFiles /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src//CMakeFiles/progress.marks + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/all + $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.82/LspCpp/CMakeFiles 0 .PHONY : all # The main clean target clean: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/clean + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/clean .PHONY : clean # The main clean target @@ -151,22 +151,22 @@ clean/fast: clean # Prepare targets for installation. preinstall: all - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/preinstall + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/preinstall .PHONY : preinstall # Prepare targets for installation. preinstall/fast: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/preinstall + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/preinstall .PHONY : preinstall/fast # clear depends depend: - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 .PHONY : depend # Convenience name for target. third_party/uri/src/CMakeFiles/network-uri.dir/rule: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/CMakeFiles/network-uri.dir/rule + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/CMakeFiles/network-uri.dir/rule .PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/rule # Convenience name for target. @@ -175,7 +175,7 @@ network-uri: third_party/uri/src/CMakeFiles/network-uri.dir/rule # fast build rule for target. network-uri/fast: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/build + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/build .PHONY : network-uri/fast detail/uri_advance_parts.o: detail/uri_advance_parts.cpp.o @@ -183,7 +183,7 @@ detail/uri_advance_parts.o: detail/uri_advance_parts.cpp.o # target to build an object file detail/uri_advance_parts.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o .PHONY : detail/uri_advance_parts.cpp.o detail/uri_advance_parts.i: detail/uri_advance_parts.cpp.i @@ -191,7 +191,7 @@ detail/uri_advance_parts.i: detail/uri_advance_parts.cpp.i # target to preprocess a source file detail/uri_advance_parts.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i .PHONY : detail/uri_advance_parts.cpp.i detail/uri_advance_parts.s: detail/uri_advance_parts.cpp.s @@ -199,7 +199,7 @@ detail/uri_advance_parts.s: detail/uri_advance_parts.cpp.s # target to generate assembly for a file detail/uri_advance_parts.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s .PHONY : detail/uri_advance_parts.cpp.s detail/uri_normalize.o: detail/uri_normalize.cpp.o @@ -207,7 +207,7 @@ detail/uri_normalize.o: detail/uri_normalize.cpp.o # target to build an object file detail/uri_normalize.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o .PHONY : detail/uri_normalize.cpp.o detail/uri_normalize.i: detail/uri_normalize.cpp.i @@ -215,7 +215,7 @@ detail/uri_normalize.i: detail/uri_normalize.cpp.i # target to preprocess a source file detail/uri_normalize.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i .PHONY : detail/uri_normalize.cpp.i detail/uri_normalize.s: detail/uri_normalize.cpp.s @@ -223,7 +223,7 @@ detail/uri_normalize.s: detail/uri_normalize.cpp.s # target to generate assembly for a file detail/uri_normalize.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s .PHONY : detail/uri_normalize.cpp.s detail/uri_parse.o: detail/uri_parse.cpp.o @@ -231,7 +231,7 @@ detail/uri_parse.o: detail/uri_parse.cpp.o # target to build an object file detail/uri_parse.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o .PHONY : detail/uri_parse.cpp.o detail/uri_parse.i: detail/uri_parse.cpp.i @@ -239,7 +239,7 @@ detail/uri_parse.i: detail/uri_parse.cpp.i # target to preprocess a source file detail/uri_parse.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i .PHONY : detail/uri_parse.cpp.i detail/uri_parse.s: detail/uri_parse.cpp.s @@ -247,7 +247,7 @@ detail/uri_parse.s: detail/uri_parse.cpp.s # target to generate assembly for a file detail/uri_parse.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s .PHONY : detail/uri_parse.cpp.s detail/uri_parse_authority.o: detail/uri_parse_authority.cpp.o @@ -255,7 +255,7 @@ detail/uri_parse_authority.o: detail/uri_parse_authority.cpp.o # target to build an object file detail/uri_parse_authority.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o .PHONY : detail/uri_parse_authority.cpp.o detail/uri_parse_authority.i: detail/uri_parse_authority.cpp.i @@ -263,7 +263,7 @@ detail/uri_parse_authority.i: detail/uri_parse_authority.cpp.i # target to preprocess a source file detail/uri_parse_authority.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i .PHONY : detail/uri_parse_authority.cpp.i detail/uri_parse_authority.s: detail/uri_parse_authority.cpp.s @@ -271,7 +271,7 @@ detail/uri_parse_authority.s: detail/uri_parse_authority.cpp.s # target to generate assembly for a file detail/uri_parse_authority.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s .PHONY : detail/uri_parse_authority.cpp.s detail/uri_resolve.o: detail/uri_resolve.cpp.o @@ -279,7 +279,7 @@ detail/uri_resolve.o: detail/uri_resolve.cpp.o # target to build an object file detail/uri_resolve.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o .PHONY : detail/uri_resolve.cpp.o detail/uri_resolve.i: detail/uri_resolve.cpp.i @@ -287,7 +287,7 @@ detail/uri_resolve.i: detail/uri_resolve.cpp.i # target to preprocess a source file detail/uri_resolve.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i .PHONY : detail/uri_resolve.cpp.i detail/uri_resolve.s: detail/uri_resolve.cpp.s @@ -295,7 +295,7 @@ detail/uri_resolve.s: detail/uri_resolve.cpp.s # target to generate assembly for a file detail/uri_resolve.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s .PHONY : detail/uri_resolve.cpp.s uri.o: uri.cpp.o @@ -303,7 +303,7 @@ uri.o: uri.cpp.o # target to build an object file uri.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o .PHONY : uri.cpp.o uri.i: uri.cpp.i @@ -311,7 +311,7 @@ uri.i: uri.cpp.i # target to preprocess a source file uri.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.i .PHONY : uri.cpp.i uri.s: uri.cpp.s @@ -319,7 +319,7 @@ uri.s: uri.cpp.s # target to generate assembly for a file uri.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.s .PHONY : uri.cpp.s uri_builder.o: uri_builder.cpp.o @@ -327,7 +327,7 @@ uri_builder.o: uri_builder.cpp.o # target to build an object file uri_builder.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o .PHONY : uri_builder.cpp.o uri_builder.i: uri_builder.cpp.i @@ -335,7 +335,7 @@ uri_builder.i: uri_builder.cpp.i # target to preprocess a source file uri_builder.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.i .PHONY : uri_builder.cpp.i uri_builder.s: uri_builder.cpp.s @@ -343,7 +343,7 @@ uri_builder.s: uri_builder.cpp.s # target to generate assembly for a file uri_builder.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.s .PHONY : uri_builder.cpp.s uri_errors.o: uri_errors.cpp.o @@ -351,7 +351,7 @@ uri_errors.o: uri_errors.cpp.o # target to build an object file uri_errors.cpp.o: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o .PHONY : uri_errors.cpp.o uri_errors.i: uri_errors.cpp.i @@ -359,7 +359,7 @@ uri_errors.i: uri_errors.cpp.i # target to preprocess a source file uri_errors.cpp.i: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.i + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.i .PHONY : uri_errors.cpp.i uri_errors.s: uri_errors.cpp.s @@ -367,7 +367,7 @@ uri_errors.s: uri_errors.cpp.s # target to generate assembly for a file uri_errors.cpp.s: - cd /usr/local/src/asymptote-2.80/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.s + cd /usr/local/src/asymptote-2.82/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.s .PHONY : uri_errors.cpp.s # Help Target @@ -418,6 +418,6 @@ help: # No rule that depends on this can have commands that come from listfiles # because they might be regenerated. cmake_check_build_system: - cd /usr/local/src/asymptote-2.80/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 + cd /usr/local/src/asymptote-2.82/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 .PHONY : cmake_check_build_system diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake index 317e18a983..7adcfd9711 100644 --- a/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake +++ b/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake @@ -1,4 +1,4 @@ -# Install script for directory: /usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src +# Install script for directory: /usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src # Set the install prefix if(NOT DEFINED CMAKE_INSTALL_PREFIX) @@ -43,6 +43,6 @@ if(NOT DEFINED CMAKE_OBJDUMP) endif() if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) - file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/usr/local/src/asymptote-2.80/LspCpp/third_party/uri/src/libnetwork-uri.a") + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/usr/local/src/asymptote-2.82/LspCpp/third_party/uri/src/libnetwork-uri.a") endif() diff --git a/graphics/asymptote/Makefile.in b/graphics/asymptote/Makefile.in index 2e6bec801f..a59ebd9d8d 100644 --- a/graphics/asymptote/Makefile.in +++ b/graphics/asymptote/Makefile.in @@ -355,7 +355,10 @@ cleaner: FORCE clean distclean: FORCE cleaner cd doc && $(MAKE) distclean - cd LspCpp && rm -rf CMakeCache.txt CMakeDoxyfile.in CMakeDoxygenDefaults.cmake CMakeFiles Makefile cmake_install.cmake + cd LspCpp && rm -rf CMakeCache.txt CMakeDoxyfile.in \ + CMakeDoxygenDefaults.cmake CMakeFiles Makefile cmake_install.cmake \ + third_party/uri/src/CMakeFiles/network-uri.dir/detail + cleanest: FORCE maintainer-clean maintainer-clean: FORCE distclean diff --git a/graphics/asymptote/ReleaseNotes b/graphics/asymptote/ReleaseNotes index 6262a7d7df..94ce0070a8 100644 --- a/graphics/asymptote/ReleaseNotes +++ b/graphics/asymptote/ReleaseNotes @@ -1,4 +1,25 @@ +Release Notes for Version 2.82 +Support for Ghostscript 9.56 was added. +Ambiguous functions are listed. +The dvisvgmMultipleFiles option is now enabled by default. +A bug in generating PDF labels was fixed. +The mean color of multicoloured patches is output only for PRC code. +Subdivision crack adjustments were disabled for transparent patches. +The OpenGL transparency shader was further accelerated. +WebGL bounding boxes are now computed by the client upon loading. +Version 1.02 of the AsyGL library was released. + +Release Notes for Version 2.81 + +Schur decompositions were implemented. A bug in uniform() was fixed. +The Xasy bounding box and a crash when opening Xasy files were fixed. +The transparency offset buffer is zeroed when GPU compression is unavailable. +The surface constructor for solids of revolution was documented. +Support for pkg-config was added. Opaque rendering on platforms lacking +GL_ARB_fragment_shader_interlock was fixed. + Release Notes for Version 2.80 + Compression of empty transparent pixel counts and other optimizations were implemented in the transparency shader. A weighted least-squares fit was added. diff --git a/graphics/asymptote/abs3doutfile.h b/graphics/asymptote/abs3doutfile.h index 78568c14a9..2a6041e775 100644 --- a/graphics/asymptote/abs3doutfile.h +++ b/graphics/asymptote/abs3doutfile.h @@ -19,56 +19,52 @@ protected: bool singleprecision; public: abs3Doutfile(bool singleprecision=false) : singleprecision(singleprecision) {} - virtual ~abs3Doutfile() = default; + virtual ~abs3Doutfile()=default; virtual void close()=0; - virtual void addPatch(triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) = 0; + virtual void addPatch(triple const* controls, prc::RGBAColour const* c)=0; virtual void addStraightPatch( - triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) = 0; + triple const* controls, prc::RGBAColour const* c)=0; virtual void addBezierTriangle( - triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) = 0; + triple const* controls, prc::RGBAColour const* c)=0; virtual void addStraightBezierTriangle( - triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) = 0; + triple const* controls, prc::RGBAColour const* c)=0; #ifdef HAVE_LIBGLM - virtual void addMaterial(Material const& mat) = 0; + virtual void addMaterial(Material const& mat)=0; #endif - virtual void addSphere(triple const& center, double radius) = 0; + virtual void addSphere(triple const& center, double radius)=0; - virtual void addHemisphere(triple const& center, double radius, double const& polar, double const& azimuth) = 0; + virtual void addHemisphere(triple const& center, double radius, double const& polar, double const& azimuth)=0; virtual void addCylinder(triple const& center, double radius, double height, double const& polar, const double& azimuth, - bool core) = 0; + bool core)=0; virtual void addDisk(triple const& center, double radius, - double const& polar, const double& azimuth) = 0; + double const& polar, const double& azimuth)=0; - virtual void addTube(const triple* g, double width, - const triple& Min, const triple& Max, bool core) = 0; + virtual void addTube(const triple* g, double width, bool core)=0; virtual void addTriangles(size_t nP, const triple* P, size_t nN, const triple* N, size_t nC, const prc::RGBAColour* C, size_t nI, const uint32_t (* PI)[3], - const uint32_t (* NI)[3], const uint32_t (* CI)[3], - const triple& Min, const triple& Max) = 0; + const uint32_t (* NI)[3], + const uint32_t (* CI)[3])=0; virtual void addCurve(const triple& z0, const triple& c0, - const triple& c1, const triple& z1, - const triple& Min, const triple& Max) = 0; + const triple& c1, const triple& z1)=0; - virtual void addCurve(const triple& z0, const triple& z1, - const triple& Min, const triple& Max) = 0; + virtual void addCurve(const triple& z0, const triple& z1)=0; - virtual void addPixel(const triple& z0, double width, - const triple& Min, const triple& Max) = 0; + virtual void addPixel(const triple& z0, double width)=0; - virtual void precision(int digits) = 0; + virtual void precision(int digits)=0; }; diff --git a/graphics/asymptote/asy-keywords.el b/graphics/asymptote/asy-keywords.el index a66ff28210..73b5e633c1 100644 --- a/graphics/asymptote/asy-keywords.el +++ b/graphics/asymptote/asy-keywords.el @@ -2,16 +2,16 @@ ;; This file is automatically generated by asy-list.pl. ;; Changes will be overwritten. ;; -(defvar asy-keywords-version "2.80") +(defvar asy-keywords-version "2.82") (defvar asy-keyword-name '( and controls tension atleast curl if else while for do return break continue struct typedef new access import unravel from include quote static public private restricted this explicit true false null cycle newframe operator )) (defvar asy-type-name '( -Braid FitResult Label Legend Solution TreeNode abscissa arc arrowhead binarytree binarytreeNode block bool bool3 bounds bqe circle conic coord coordsys cputime ellipse evaluatedpoint file filltype frame grid3 guide horner hsv hyperbola int inversion key light line linefit marginT marker mass node object pair parabola patch path path3 pen picture point position positionedvector projection rational real revolution scaleT scientific segment side simplex slice solution splitface string surface tensionSpecifier ticklocate ticksgridT tickvalues transform transformation tree triangle trilinear triple vector vertex void )) +Braid FitResult Label Legend Solution TreeNode abscissa arc arrowhead binarytree binarytreeNode block bool bool3 bounds bqe circle conic coord coordsys cputime ellipse evaluatedpoint file filltype frame grid3 guide horner hsv hyperbola int inversion key light line linefit marginT marker mass node object pair parabola patch path path3 pen picture point position positionedvector projection rational real realschur revolution scaleT schur scientific segment side simplex slice solution splitface string surface tensionSpecifier ticklocate ticksgridT tickvalues transform transformation tree triangle trilinear triple vector vertex void )) (defvar asy-function-name '( -AND Align Arc ArcArrow ArcArrows Arrow Arrows AtA Automatic AvantGarde B03 B13 B23 B33 BBox BWRainbow BWRainbow2 Bar Bars BeginArcArrow BeginArrow BeginBar BeginDotMargin BeginMargin BeginPenMargin Blank Bookman Bottom BottomTop Bounds Break Broken BrokenLog CLZ CTZ Ceil Circle CircleBarIntervalMarker Cos Courier CrossIntervalMarker DOSendl DOSnewl DefaultFormat DefaultLogFormat Degrees Dir DotMargin DotMargins Dotted Draw Drawline Embed EndArcArrow EndArrow EndBar EndDotMargin EndMargin EndPenMargin Fill FillDraw Finite Floor Format Full Gaussian Gaussrand Gaussrandpair Gradient Grayscale Helvetica Hermite HookHead InOutTicks InTicks Jn Label Landscape Left LeftRight LeftTicks Legend Linear Log LogFormat Margin Margins Mark MidArcArrow MidArrow NOT NewCenturySchoolBook NoBox NoMargin NoModifier NoTicks NoTicks3 NoZero NoZeroFormat None OR OmitFormat OmitTick OmitTickInterval OmitTickIntervals OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RGB RadialShade RadialShadeDraw Rainbow Range Relative Right RightTicks Rotate Round SQR Scale ScaleX ScaleY ScaleZ Seascape Shift Sin Slant Spline StickIntervalMarker Straight Symbol Tan TeXify Ticks Ticks3 TildeIntervalMarker TimesRoman Top TrueMargin UnFill UpsideDown Wheel X XEquals XOR XY XYEquals XYZero XYgrid XZEquals XZZero XZero XZgrid Y YEquals YXgrid YZ YZEquals YZZero YZero YZgrid Yn Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _begingroup3 _cputime _draw _eval _findroot _image _labelpath _projection _shipout _strokepath _texpath aCos aSin aTan abort abs abs2 accel acos acosh acot acsc activatequote add addArrow addMargins addSaveFunction addpenarc addpenline addseg adjust alias align all altitude angabscissa angle angledegrees angpoint animate annotate anticomplementary antipedal apply approximate arc arcarrowsize arccircle arcdir arcfromcenter arcfromfocus arclength arcnodesnumber arcpoint arcsubtended arcsubtendedcenter arctime arctopath array arrow arrow2 arrowbase arrowbasepoints arrowsize ascii asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit attach attract atupdate autoformat autoscale autoscale3 axes axes3 axialshade axis axiscoverage azimuth babel background bangles bar barmarksize barsize basealign baseline bbox beep begin beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial bins bisector bisectorpoint bispline bispline0 bitreverse blend blockconnector box bqe brace breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte byteinv calculateScaling canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment check_fpt_zero checkconditionlength checker checkincreasing checklengths checkposition checkpt checkptincube checktriangle choose circle circlebarframe circlemarkradius circlenodesnumber circumcenter circumcircle clamped clear clip clipdraw close cmyk code colatitude collect collinear color colorless colors colorspace comma compassmark complement complementary concat concurrent cone conic conicnodesnumber conictype conj connect containmentTree contains contour contour3 controlSpecifier convert coordinates coordsys copy copyPairOrTriple cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder deactivatequote debugger deconstruct defaultdir defaultformat defaultpen defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawCylinder drawDisk drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPhoton drawScalar drawSphere drawTube drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawbeziertriangle drawline drawpixel drawstrokepath drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 embedplayer empty enclose end endclip endgroup endgroup3 endl endpoint endpoints eof eol equation equations erase erasestep erf erfc error errorbar errorbars eval excenter excircle exit exitfunction exp expfactors expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find findall findroot finite finiteDifferenceJacobian firstcut firstframe fit fit2 fixedscaling floor flush fmdefaults fmod focusToCenter font fontcommand fontsize foot format frac frequency fromCenter fromFocus fspline functionshade gamma gcd generate_random_backtrace generateticks gergonne getc getint getpair getreal getstring gettriple gluon gouraudshade graph graphic graphicscale graphwithderiv gray grestore grid grid3 gsave halfbox hatch hdiffdiv hermite hex histogram history hline hprojection hsv hyperbola hyperbolanodesnumber hyperlink hypot identity image implicitsurface importv3d incenter incentral incircle increasing incrementposition indexedfigure initdefaults initialized input inradius insert inside insphere integrate interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isDuplicate isnan isogonal isogonalconjugate isometry isotomic isotomicconjugate isparabola italic item jobname key kurtosis kurtosisexcess label labelaxis labelmargin labelpath labels labeltick labelx labelx3 labely labely3 labelz labelz3 lastcut latex latitude latticeshade layer layout lcm ldexp leastsquares legend legenditem length lexorder lift light limits line linear linecap lineinversion linejoin linemargin lineskip linetype linewidth link list lm_enorm lm_evaluate_default lm_lmdif lm_lmpar lm_minimize lm_print_default lm_print_quiet lm_qrfac lm_qrsolv locale locate locatefile location log log10 log1p logaxiscoverage longitude lookup make3dgrid makeMappingArray makeNode makecircle makedraw makepen maketriangle map mapArray mapTemplate margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markthin markuniform mass masscenter massformat math max max3 maxAfterTransform maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minAfterTransform minbezier minbound minipage minratio mintimes miterlimit mktemp momArrowPath momarrowsize monotonic multifigure nGrad nativeformat natural newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa node none norm normalout normalvideo notaknot nowarn numberpage nurb object offset onpath opacity opposite orient orientation origin orthic orthocentercenter outdirectory outformat outline outname outprefix output overloadedMessage overwrite pack pad pairs palette parabola parabolanodesnumber parallel parallelogram partialsum patchwithnormals path path3 pathbetween pathinface pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom phi1 phi2 phi3 phi4 photon piecewisestraight point polar polarconicroutine polargraph polygon popcount postcontrol postscript pow10 ppoint prc prc0 prconly precision precontrol prepend primitive printBytecode print_random_addresses progress project projection projecttospan projecttospan_findcoeffs purge pwhermite quadpatches quadrant quadraticroots quantize quarticroots quotient radialshade radians radicalcenter radicalline radius rand randompath rationalidentity rd readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename render replace report resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rms rotate rotateO rotation round roundbox roundedpath roundrectangle samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment segmentlimits sequence setpens sgn sgnd sharpangle sharpdegrees shift shiftless shipout shipout3 show simeq simplex simplexInit simplexPhase1 simplexPhase2 simplexTableau simplexWrite simpson sin sinh size size3 skewness skip slant sleep slice slope slopefield solve solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile stripsuffix strokepath subdivide subitem subpath substr sum surface symmedial symmedian system tab tableau tan tangent tangential tangents tanh tell tensionSpecifier tensorshade tex texcolor texify texpath texpreamble texreset texshipout texsize texstring textpath thick thin tick tickMax tickMax3 tickMin tickMin3 ticklabelshift ticklocate tildeframe tildemarksize tile tiling time times title titlepage topbox transform transformation transpose trembleFuzz triangle triangleAbc triangleabc triangletoquads trianglewithnormals triangulate tricoef tridiagonal trilinear trim truepoint tube type uncycle unfill uniform unique unit unitrand unitsize unityroot unstraighten upcase updatefunction uperiodic upscale uptodate usepackage usersetting usetypescript usleep value variance variancebiased vbox vector vectorfield verbatim view vline vperiodic vprojection warn warning windingnumber write xasyKEY xaxis xaxis3 xaxis3At xaxisAt xequals xlimits xmap xpart xscale xscaleO xtick xtick3 xtrans yaxis yaxis3 yaxis3At yaxisAt yequals ylimits ypart yscale yscaleO ytick ytick3 ytrans zaxis3 zaxis3At zero zlimits zpart ztick ztick3 ztrans )) +AND Align Arc ArcArrow ArcArrows Arrow Arrows AtA Automatic AvantGarde B03 B13 B23 B33 BBox BWRainbow BWRainbow2 Bar Bars BeginArcArrow BeginArrow BeginBar BeginDotMargin BeginMargin BeginPenMargin Blank Bookman Bottom BottomTop Bounds Break Broken BrokenLog CLZ CTZ Ceil Circle CircleBarIntervalMarker Cos Courier CrossIntervalMarker DOSendl DOSnewl DefaultFormat DefaultLogFormat Degrees Dir DotMargin DotMargins Dotted Draw Drawline Embed EndArcArrow EndArrow EndBar EndDotMargin EndMargin EndPenMargin Fill FillDraw Finite Floor Format Full Gaussian Gaussrand Gaussrandpair Gradient Grayscale Helvetica Hermite HookHead InOutTicks InTicks Jn Label Landscape Left LeftRight LeftTicks Legend Linear Log LogFormat Margin Margins Mark MidArcArrow MidArrow NOT NewCenturySchoolBook NoBox NoMargin NoModifier NoTicks NoTicks3 NoZero NoZeroFormat None OR OmitFormat OmitTick OmitTickInterval OmitTickIntervals OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RGB RadialShade RadialShadeDraw Rainbow Range Relative Right RightTicks Rotate Round SQR Scale ScaleX ScaleY ScaleZ Seascape Shift Sin Slant Spline StickIntervalMarker Straight Symbol Tan TeXify Ticks Ticks3 TildeIntervalMarker TimesRoman Top TrueMargin UnFill UpsideDown Wheel X XEquals XOR XY XYEquals XYZero XYgrid XZEquals XZZero XZero XZgrid Y YEquals YXgrid YZ YZEquals YZZero YZero YZgrid Yn Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _begingroup3 _cputime _draw _eval _findroot _image _labelpath _projection _schur _shipout _strokepath _texpath aCos aSin aTan abort abs abs2 accel acos acosh acot acsc activatequote add addArrow addMargins addSaveFunction addpenarc addpenline addseg adjust alias align all altitude angabscissa angle angledegrees angpoint animate annotate anticomplementary antipedal apply approximate arc arcarrowsize arccircle arcdir arcfromcenter arcfromfocus arclength arcnodesnumber arcpoint arcsubtended arcsubtendedcenter arctime arctopath array arrow arrow2 arrowbase arrowbasepoints arrowsize ascii asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit attach attract atupdate autoformat autoscale autoscale3 axes axes3 axialshade axis axiscoverage azimuth babel background bangles bar barmarksize barsize basealign baseline bbox beep begin beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial bins bisector bisectorpoint bispline bispline0 bitreverse blend blockconnector box bqe brace breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte byteinv calculateScaling canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment check_fpt_zero checkconditionlength checker checkincreasing checklengths checkposition checkpt checkptincube checktriangle choose circle circlebarframe circlemarkradius circlenodesnumber circumcenter circumcircle clamped clear clip clipdraw close cmyk code colatitude collect collinear color colorless colors colorspace comma compassmark complement complementary concat concurrent cone conic conicnodesnumber conictype conj connect containmentTree contains contour contour3 controlSpecifier convert coordinates coordsys copy copyPairOrTriple cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder deactivatequote debugger deconstruct defaultdir defaultformat defaultpen defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawCylinder drawDisk drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPhoton drawScalar drawSphere drawTube drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawbeziertriangle drawline drawpixel drawstrokepath drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 embedplayer empty enclose end endclip endgroup endgroup3 endl endpoint endpoints eof eol equation equations erase erasestep erf erfc error errorbar errorbars eval excenter excircle exit exitfunction exp expfactors expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find findall findroot finite finiteDifferenceJacobian firstcut firstframe fit fit2 fixedscaling floor flush fmdefaults fmod focusToCenter font fontcommand fontsize foot format frac frequency fromCenter fromFocus fspline functionshade gamma gcd generate_random_backtrace generateticks gergonne getc getint getpair getreal getstring gettriple gluon gouraudshade graph graphic graphicscale graphwithderiv gray grestore grid grid3 gsave halfbox hatch hdiffdiv hermite hex histogram history hline hprojection hsv hyperbola hyperbolanodesnumber hyperlink hypot identity image implicitsurface importv3d incenter incentral incircle increasing incrementposition indexedfigure initdefaults initialized input inradius insert inside insphere integrate interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isDuplicate isnan isogonal isogonalconjugate isometry isotomic isotomicconjugate isparabola italic item jobname key kurtosis kurtosisexcess label labelaxis labelmargin labelpath labels labeltick labelx labelx3 labely labely3 labelz labelz3 lastcut latex latitude latticeshade layer layout lcm ldexp leastsquares legend legenditem length lexorder lift light limits line linear linecap lineinversion linejoin linemargin lineskip linetype linewidth link list lm_enorm lm_evaluate_default lm_lmdif lm_lmpar lm_minimize lm_print_default lm_print_quiet lm_qrfac lm_qrsolv locale locate locatefile location log log10 log1p logaxiscoverage longitude lookup make3dgrid makeMappingArray makeNode makecircle makedraw makepen maketriangle map mapArray mapTemplate margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markthin markuniform mass masscenter massformat math max max3 maxAfterTransform maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minAfterTransform minbezier minbound minipage minratio mintimes miterlimit mktemp momArrowPath momarrowsize monotonic multifigure nGrad nativeformat natural newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa node none norm normalout normalvideo notaknot nowarn numberpage nurb object offset onpath opacity opposite orient orientation origin orthic orthocenter orthocentercenter outdirectory outformat outline outname outprefix output overloadedMessage overwrite pack pad pairs palette parabola parabolanodesnumber parallel parallelogram partialsum patchwithnormals path path3 pathbetween pathinface pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom phi1 phi2 phi3 phi4 photon piecewisestraight point polar polarconicroutine polargraph polygon popcount postcontrol postscript pow10 ppoint prc prc0 prconly precision precontrol prepend primitive printBytecode print_random_addresses progress project projection projecttospan projecttospan_findcoeffs purge pwhermite quadpatches quadrant quadraticroots quantize quarticroots quotient radialshade radians radicalcenter radicalline radius rand randompath rationalidentity rd readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename render replace report resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rms rotate rotateO rotation round roundbox roundedpath roundrectangle samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless schur scientific search searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment segmentlimits sequence setpens sgn sgnd sharpangle sharpdegrees shift shiftless shipout shipout3 show simeq simplex simplexInit simplexPhase1 simplexPhase2 simplexTableau simplexWrite simpson sin sinh size size3 skewness skip slant sleep slice slope slopefield solve solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile stripsuffix strokepath subdivide subitem subpath substr sum surface symmedial symmedian system tab tableau tan tangent tangential tangents tanh tell tensionSpecifier tensorshade tex texcolor texify texpath texpreamble texreset texshipout texsize texstring textpath thick thin tick tickMax tickMax3 tickMin tickMin3 ticklabelshift ticklocate tildeframe tildemarksize tile tiling time times title titlepage topbox transform transformation transpose trembleFuzz triangle triangleAbc triangleabc triangletoquads trianglewithnormals triangulate tricoef tridiagonal trilinear trim truepoint tube type uncycle unfill uniform unique unit unitrand unitsize unityroot unstraighten upcase updatefunction uperiodic upscale uptodate usepackage usersetting usetypescript usleep value variance variancebiased vbox vector vectorfield verbatim view vline vperiodic vprojection warn warning windingnumber write xasyKEY xaxis xaxis3 xaxis3At xaxisAt xequals xlimits xmap xpart xscale xscaleO xtick xtick3 xtrans yaxis yaxis3 yaxis3At yaxisAt yequals ylimits ypart yscale yscaleO ytick ytick3 ytrans zaxis3 zaxis3At zero zlimits zpart ztick ztick3 ztrans )) (defvar asy-variable-name '( Accent AliceBlue Align Allow AntiqueWhite Apricot Aqua Aquamarine Aspect Azure BeginPoint Beige Bisque Bittersweet Black BlanchedAlmond Blue BlueGreen BlueViolet Blues Both BrBG Break BrickRed Brown BuGn BuPu BurlyWood BurntOrange CCW CMRmap CW CadetBlue CarnationPink Center Centered Cerulean Chartreuse Chocolate Coeff Coral CornflowerBlue Cornsilk Crimson Crop Cyan Dandelion Dark2 DarkBlue DarkCyan DarkGoldenrod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen DarkOrange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DefaultHead DimGray DodgerBlue Dotted Down Draw E ENE EPS ESE E_Euler E_PC E_RK2 E_RK3BS Emerald EndPoint Euler Fill FillDraw FireBrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite GnBu Gold Goldenrod Gray Green GreenYellow Greens Greys Honeydew HookHead Horizontal HotPink I IgnoreAspect IndianRed Indigo Infinity Ivory JOIN_IN JOIN_OUT JungleGreen Khaki LM_DWARF LM_MACHEP LM_SQRT_DWARF LM_SQRT_GIANT LM_USERTOL Label Lavender LavenderBlush LawnGreen Left LeftJustified LeftSide LemonChiffon LightBlue LightCoral LightCyan LightGoldenrodYellow LightGreen LightGrey LightPink LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue LightYellow Lime LimeGreen Linear Linen Log Logarithmic Magenta Mahogany Mark MarkFill MarkFillable MarkPath Maroon Max MediumAquamarine MediumBlue MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed Melon MidPoint MidnightBlue Min MintCream MistyRose Moccasin Move MoveQuiet Mulberry N NE NNE NNW NULL_VERTEX NW NavajoWhite Navy NavyBlue NoAlign NoCrop NoFill NoSide OldLace Olive OliveDrab OliveGreen OrRd Orange OrangeRed Oranges Orchid Ox Oy PC PRGn Paired PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip Pastel1 Pastel2 Peach PeachPuff Periwinkle Peru PiYG PineGreen Pink Plum PowderBlue ProcessBlue PuBu PuBuGn PuOr PuRd Purple Purples RELEASE RK2 RK3 RK3BS RK4 RK5 RK5DP RK5F RawSienna RdBu RdGy RdPu RdYlBu RdYlGn Red RedOrange RedViolet Reds Rhodamine Right RightJustified RightSide RosyBrown RoyalBlue RoyalPurple RubineRed S SE SSE SSW SW SaddleBrown Salmon SandyBrown SeaGreen Seashell Sepia Set1 Set2 Set3 Sienna Silver SimpleHead SkyBlue SlateBlue SlateGray Snow Spectral SpringGreen SteelBlue Suppress SuppressQuiet Tan TeXHead Teal TealBlue Thistle Ticksize Tomato Turquoise UnFill Up VERSION Value Vertical Violet VioletRed W WNW WSW Wheat White WhiteSmoke WildStrawberry XHIGH XLOW XYAlign YAlign YHIGH YLOW Yellow YellowGreen YellowOrange YlGn YlGnBu YlOrBr YlOrRd ZHIGH ZLOW _outpipe aboveequationskip addpenarc addpenline align allowstepping angularsystem animationdelay appendsuffix arcarrowangle arcarrowfactor arrow2sizelimit arrowangle arrowbarb arrowdir arrowfactor arrowhookfactor arrowlength arrowsizelimit arrowtexfactor authorpen autumn axis axiscoverage axislabelfactor background backgroundcolor backgroundpen barfactor barmarksizefactor basealign baselinetemplate bernstein beveljoin bigvertexpen bigvertexsize binary black blue bm bone bottom bp bracedefaultratio braceinnerangle bracemidangle braceouterangle brg brown bullet bwr byfoci byvertices camerafactor chartreuse circlemarkradiusfactor circlenodesnumberfactor circleprecision circlescale cividis cm codefile codepen codeskip colorPen coloredNodes coloredSegments conditionlength conicnodesfactor cool coolwarm copper count cputimeformat crossmarksizefactor currentcoordsys currentlight currentpatterns currentpen currentpicture currentposition currentprojection curvilinearsystem cuttings cyan darkblue darkbrown darkcyan darkgray darkgreen darkgrey darkmagenta darkolive darkred dashdotted dashed datepen dateskip debuggerlines debugging deepblue deepcyan deepgray deepgreen deepgrey deepmagenta deepred deepyellow default defaultControl defaultS defaultbackpen defaultcoordsys defaultexcursion defaultfilename defaultformat defaultmassformat defaultpen defaultseparator diamond differentlengths dot dotfactor dotfilltype dotframe dotted doublelinepen doublelinespacing down duplicateFuzz ellipsenodesnumberfactor eps epsgeo epsilon evenodd expansionfactor extendcap fermionpen figureborder figuremattpen file3 firstnode firststep foregroundcolor fuchsia fuzz gapfactor ghostpen gist_earth gist_ncar gist_stern gluonamplitude gluonpen gluonratio gray green grey hatchepsilon havepagenumber heavyblue heavycyan heavygray heavygreen heavygrey heavymagenta heavyred hline hot hsv hwratio hyperbolanodesnumberfactor identity identity4 ignore implicitshipout inch inches includegraphicscommand inf inferno infinity institutionpen intMax intMin invert invisible itempen itemskip itemstep jet labelmargin landscape lastnode left legendhskip legendlinelength legendmargin legendmarkersize legendmaxrelativewidth legendvskip lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightolive lightred lightyellow linemargin lm_infmsg lm_shortmsg longdashdotted longdashed magenta magma magneticRadius mantissaBits markangleradius markangleradiusfactor markanglespace markanglespacefactor maxDenominator maxrefinements mediumblue mediumcyan mediumgray mediumgreen mediumgrey mediummagenta mediumred mediumyellow middle minDistDefault minblockheight minblockwidth mincirclediameter minipagemargin minipagewidth minvertexangle miterjoin mm momarrowfactor momarrowlength momarrowmargin momarrowoffset momarrowpen monoPen morepoints nCircle nan newbulletcolor ngraph nil nipy_spectral nmesh nobasealign nodeMarginDefault nodesystem nomarker nopoint noprimary nullpath nullpen numarray ocgindex oldbulletcolor olive orange origin overpaint page pageheight pagemargin pagenumberalign pagenumberpen pagenumberposition pagewidth paleblue palecyan palegray palegreen palegrey palemagenta palered paleyellow parabolanodesnumberfactor perpfactor phi photonamplitude photonpen photonratio pi pink plain plain_bounds plain_scaling plasma plus preamblenodes pt purple r3 r4a r4b randMax realDigits realEpsilon realMax realMin red relativesystem reverse right roundcap roundjoin royalblue salmon saveFunctions scalarpen seismic sequencereal settings signedtrailingzero simplex solid spinner spring springgreen sqrtEpsilon squarecap squarepen startposition stdin stdout stepfactor stepfraction steppagenumberpen stepping stickframe stickmarksizefactor stickmarkspacefactor summer swap tab10 tab20 tab20b tab20c textpen ticksize tildeframe tildemarksizefactor tinv titlealign titlepagepen titlepageposition titlepen titleskip top trailingzero treeLevelStep treeMinNodeWidth treeNodeStep trembleAngle trembleFrequency trembleRandom tubegranularity twilight twilight_shifted undefined unitcircle unitsquare up urlpen urlskip v3dheadertypes v3dtypes version vertexpen vertexsize viewportmargin viewportsize viridis vline white winter wistia wye yellow ylabelwidth zeroTransform zerotickfuzz zerowinding )) diff --git a/graphics/asymptote/asy.list b/graphics/asymptote/asy.list index 9a8bf1ca2c..80f333e14d 100644 --- a/graphics/asymptote/asy.list +++ b/graphics/asymptote/asy.list @@ -986,6 +986,7 @@ bool alias(ScaleT a, ScaleT b); bool alias(side a, side b); bool alias(arrowhead a, arrowhead b); bool alias(picture[] a, picture[] b); +bool alias(schur a, schur b); bool alias(int[] a, int[] b); bool alias(string[][] a, string[][] b); bool alias(slice a, slice b); @@ -1021,6 +1022,7 @@ bool alias(coord a, coord b); bool alias(autoscaleT a, autoscaleT b); bool alias(align a, align b); bool alias(marker[] a, marker[] b); +bool alias(realschur a, realschur b); bool alias(real[] a, real[] b); bool alias(pen[] a, pen[] b); bool alias(hsv a, hsv b); @@ -1202,6 +1204,7 @@ projection projection(triple camera, triple up=<default>, triple target=<default void endl(file file); path diamond; marginT TrueMargin(path, pen)(real begin, real end=<default>); +real bezier(real a, real b, real c, real d, real t); pair bezier(pair a, pair b, pair c, pair d, real t); triple bezier(triple a, triple b, triple c, triple d, real t); pair SSE; @@ -1419,10 +1422,12 @@ scaling operator init(); ScaleT operator init(); side operator init(); arrowhead operator init(); +schur operator init(); coord operator init(); coord operator init(); autoscaleT operator init(); align operator init(); +realschur operator init(); bool3 operator init(); bounds operator init(); scaleT operator init(); @@ -1615,6 +1620,7 @@ bool operator ==(coord a, coord b); bool operator ==(coord a, coord b); bool operator ==(autoscaleT a, autoscaleT b); bool operator ==(align a, align b); +bool operator ==(realschur a, realschur b); bool operator ==(hsv a, hsv b); bool operator ==(freezableBounds a, freezableBounds b); bool operator ==(transformation a, transformation b); @@ -1629,6 +1635,7 @@ bool operator ==(scaling a, scaling b); bool operator ==(ScaleT a, ScaleT b); bool operator ==(side a, side b); bool operator ==(arrowhead a, arrowhead b); +bool operator ==(schur a, schur b); bool operator ==(bool a, bool3 b); bool operator ==(slice a, slice b); bool operator ==(simplex a, simplex b); @@ -1687,6 +1694,7 @@ bool operator !=(coord a, coord b); bool operator !=(coord a, coord b); bool operator !=(autoscaleT a, autoscaleT b); bool operator !=(align a, align b); +bool operator !=(realschur a, realschur b); bool operator !=(hsv a, hsv b); bool operator !=(freezableBounds a, freezableBounds b); bool operator !=(transformation a, transformation b); @@ -1701,6 +1709,7 @@ bool operator !=(scaling a, scaling b); bool operator !=(ScaleT a, ScaleT b); bool operator !=(side a, side b); bool operator !=(arrowhead a, arrowhead b); +bool operator !=(schur a, schur b); bool operator !=(bool a, bool3 b); bool operator !=(slice a, slice b); bool operator !=(simplex a, simplex b); @@ -1947,6 +1956,8 @@ void deactivatequote(picture pic=<default>); string format(string format, int x, string locale=<default>); string format(string format, bool forcemath=<default>, string separator, real x, string locale=<default>); string format(string format=<default>, bool forcemath=<default>, real x, string locale=<default>); +real[][][] _schur(real[][] a); +pair[][][] _schur(pair[][] a); real expm1(real x); real[] expm1(real[] a); void activatequote(picture pic=<default>); @@ -1983,6 +1994,8 @@ frame dotframe(pen p=<default>, filltype filltype=<default>); real realMax; pair NE; real realMin; +realschur schur(real[][] a); +schur schur(pair[][] a); path nib(pen p); file _outpipe; void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>); @@ -2296,7 +2309,7 @@ void draw(picture pic=<default>, Label L=<default>, hyperbola h, align align=<de void draw(picture pic=<default>, Label L=<default>, explicit conic co, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); void draw(picture pic=<default>, Label L=<default>, arc a, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>); void draw(picture pic=<default>, triangle t, pen p=<default>, marker marker=<default>); -void draw(picture pic=<default>, triangle[] t, pen p=<default>, marker marker=<default>); +void draw(picture pic=<default>, triangle[] ts, pen p=<default>, marker marker=<default>); coordsys defaultcoordsys; string defaultmassformat; line radicalline(circle c1, circle c2); @@ -2366,6 +2379,8 @@ int sgnd(real x); int sgnd(int x); circle excircle(point A, point B, point C); circle excircle(side side); +point orthocenter(point A, point B, point C); +point orthocenter(triangle t); line extend(line l); point intersectionpoint(line l1, line l2); pair[] intersectionpoints(pair A, pair B, real a, real b, real c, real d, real f, real g); @@ -2408,10 +2423,10 @@ point[] intersectionpoints(arc a, conic co); point[] intersectionpoints(arc a1, arc a2); point[] intersectionpoints(line l, arc a); point[] intersectionpoints(arc a, line l); -point intouch(side side); -triangle intouch(triangle t); point orthocentercenter(point A, point B, point C); point orthocentercenter(triangle t); +point intouch(side side); +triangle intouch(triangle t); real rf(real x, real y, real z); bool concurrent(... line[] l); real inradius(point A, point B, point C); @@ -2493,6 +2508,10 @@ point centroid(point A, point B, point C); point centroid(triangle t); int angularsystem; path square(pair z1, pair z2); +void filldraw(picture pic=<default>, circle c, pen fillpen=<default>, pen drawpen=<default>); +void filldraw(picture pic=<default>, ellipse el, pen fillpen=<default>, pen drawpen=<default>); +void filldraw(picture pic=<default>, triangle t, pen fillpen=<default>, pen drawpen=<default>); +void filldraw(picture pic=<default>, triangle[] ts, pen fillpen=<default>, pen drawpen=<default>); point symmedian(triangle t); point symmedian(side side); line symmedian(vertex V); @@ -2740,11 +2759,13 @@ mass[] operator cast(point[] P); mass operator cast(pair m); path operator cast(mass M); guide operator cast(mass M); +path operator cast(triangle t); line operator cast(side side); point operator cast(vertex V); point operator cast(trilinear tri); circle operator cast(inversion i); inversion operator cast(circle c); +path operator ecast(segment s); circle operator ecast(ellipse el); ellipse operator ecast(conic co); parabola operator ecast(conic co); @@ -2792,6 +2813,10 @@ bool operator @(point m, line l); bool operator @(point M, conic co); bool operator @(point M, explicit circle c); bool operator @(point M, arc a); +void fill(picture pic=<default>, circle c, pen p=<default>); +void fill(picture pic=<default>, ellipse el, pen p=<default>); +void fill(picture pic=<default>, triangle t, pen p=<default>); +void fill(picture pic=<default>, triangle[] ts, pen p=<default>); triangle triangle(line l1, line l2, line l3); trilinear trilinear(triangle t, real a, real b, real c); trilinear trilinear(triangle t, point M); @@ -2999,8 +3024,8 @@ guide polargraph(picture pic=<default>, real[] r, real[] theta, guide join(... g void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>); void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>); -tickvalues NoZero(tickvalues); string NoZeroFormat(real); +tickvalues NoZero(tickvalues); guide Hermite(... guide[])(real[] splinetype(real[], real[])); guide Hermite(... guide[]); path Circle(pair c, real r, int n=<default>); @@ -3018,12 +3043,12 @@ void yequals(picture pic=<default>, Label L=<default>, real y, bool extend=<defa pair Scale(picture pic=<default>, pair z); real ScaleX(picture pic=<default>, real x); real ScaleY(picture pic=<default>, real y); -void xaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>); tickvalues generateticks(int sign, Label F=<default>, string ticklabel(real)=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, real Size=<default>, real size=<default>, transform T, pair side, path g, real limit, pen p, ticklocate locate, int[] divisor, bool opposite); +void checkconditionlength(int x, int y); +void xaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>); void yaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>); void xaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>); void yaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool autorotate=<default>); -void checkconditionlength(int x, int y); real xtrans(transform t, real x); void Top(picture, axisT)(bool extend=<default>); void Top(picture, axisT); @@ -3267,10 +3292,10 @@ grid3(picture pic)[][] XYZgrid(position pos=<default>); grid3(picture pic)[][] XYZgrid; grid3(picture pic)[] ZYZgrid(position pos=<default>); grid3(picture pic)[] ZYZgrid; -grid3 XZgrid(picture pic)(position pos=<default>); -grid3 XZgrid(picture pic); grid3(picture pic)[] YZYgrid(position pos=<default>); grid3(picture pic)[] YZYgrid; +grid3 XZgrid(picture pic)(position pos=<default>); +grid3 XZgrid(picture pic); grid3 YZgrid(picture pic)(position pos=<default>); grid3 YZgrid(picture pic); real fspline(real)(real[] x, real[] y, real[] splinetype(real[], real[])=<default>); @@ -3534,8 +3559,8 @@ void display(frame f, real margin=<default>, pair align=<default>, pen p=<defaul void display(string[] s, real margin=<default>, string[] captions=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); void display(string s, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>); void multifigure(string[] slist, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>); -int page; void subitem(string s, pen p=<default>); +int page; pen pagenumberpen; pair pagenumberalign; pair pagenumberposition; @@ -3566,8 +3591,8 @@ void asycode(bool center=<default>, string s, string options=<default>, string c void exitfunction(); bool havepagenumber; real pageheight; -void item(string s, pen p=<default>, bool step=<default>); real pagewidth; +void item(string s, pen p=<default>, bool step=<default>); picture background; void background(); pen backgroundcolor; @@ -3579,9 +3604,9 @@ pair dateskip; pair titlealign; pen titlepagepen; void titlepage(string title, string author, string institution=<default>, string date=<default>, string url=<default>, bool newslide=<default>); -pen authorpen; pair titlepageposition; pen codepen; +pen authorpen; void erasestep(int erasenode); bool checkposition(); void setpens(pen red=<default>, pen blue=<default>, pen steppen=<default>); @@ -3707,16 +3732,17 @@ real stdev(real[] A); real variance(real[] A); real legendmarkersize; real variancebiased(real[] A); +linefit operator init(); real Gaussian(real x, real sigma); real Gaussian(real x); pair Gaussrandpair(); -linefit operator init(); real Gaussrand(); real skewness(real[] A); linefit leastsquares(real[] x, real[] y); linefit leastsquares(real[] x, real[] y, real[] w); real kurtosis(real[] A); real kurtosisexcess(real[] A); +real hwratio; Relation r4a; pair[] endpoints(guide[] a); Relation r3; @@ -3735,7 +3761,6 @@ Syzygy operator init(); Relation r4b; Component wye; pair max(pair[] z); -real hwratio; pen Orchid; pen WildStrawberry; pen Magenta; @@ -3764,8 +3789,8 @@ pen BurntOrange; pen Tan; pen Aquamarine; pen Brown; -pen Lavender; pen RubineRed; +pen Lavender; pen TealBlue; pen White; pen Purple; @@ -3779,27 +3804,27 @@ pen Dandelion; pen Black; pen NavyBlue; pen Rhodamine; +pen ProcessBlue; pen YellowOrange; pen Maroon; -pen ProcessBlue; pen YellowGreen; pen LimeGreen; pen Green; pen GreenYellow; -pen Sepia; pen Emerald; +pen Sepia; pen Mulberry; pen RedViolet; pen SkyBlue; pen SeaGreen; pen VioletRed; -pen Violet; pen Periwinkle; +pen Violet; pen Thistle; pen Yellow; pen JungleGreen; -pen DarkOrchid; pen CornflowerBlue; +pen DarkOrchid; pen RoyalBlue; pen Melon; pen RoyalPurple; @@ -3850,22 +3875,22 @@ pen DarkOrange; pen CadetBlue; pen DeepPink; pen SpringGreen; -pen Silver; pen MidnightBlue; pen Olive; +pen Silver; pen OliveDrab; pen Salmon; pen Chocolate; -pen Linen; -pen SandyBrown; pen Cyan; pen Gainsboro; +pen Linen; +pen SandyBrown; pen Ivory; pen PapayaWhip; pen Red; pen Pink; -pen DeepSkyBlue; pen MintCream; +pen DeepSkyBlue; pen DarkTurquoise; pen Gray; pen MediumBlue; @@ -3882,8 +3907,8 @@ pen Blue; pen Gold; pen BlueViolet; pen Goldenrod; -pen Cornsilk; pen ForestGreen; +pen Cornsilk; pen Chartreuse; pen NavajoWhite; pen Tan; @@ -3891,18 +3916,18 @@ pen DarkMagenta; pen AntiqueWhite; pen PaleTurquoise; pen IndianRed; +pen Crimson; pen Seashell; pen Aquamarine; -pen Crimson; pen Azure; pen Brown; -pen LawnGreen; pen BurlyWood; pen Moccasin; -pen Lavender; pen DarkBlue; -pen GhostWhite; +pen LawnGreen; +pen Lavender; pen Peru; +pen GhostWhite; pen White; pen Purple; pen WhiteSmoke; @@ -3922,8 +3947,8 @@ pen PeachPuff; pen Snow; pen Maroon; pen YellowGreen; -pen Lime; pen LimeGreen; +pen Lime; pen SteelBlue; pen OldLace; pen Green; @@ -3937,10 +3962,10 @@ pen PowderBlue; pen DarkGray; pen DarkGreen; pen DarkGoldenrod; -pen Aqua; pen SkyBlue; pen SeaGreen; pen DarkViolet; +pen Aqua; pen Teal; pen AliceBlue; pen Violet; @@ -3964,12 +3989,12 @@ pen LightSalmon; pen LightSeaGreen; pen LightSkyBlue; pen Navy; -pen Sienna; pen PaleVioletRed; -pen DarkOrchid; +pen Sienna; pen CornflowerBlue; pen LightSlateGray; pen LightSteelBlue; +pen DarkOrchid; pen rgbint(int r, int g, int b); pen LightYellow; pen Coral; diff --git a/graphics/asymptote/asymptote.spec b/graphics/asymptote/asymptote.spec index c177aa59b1..1323f4f3ea 100644 --- a/graphics/asymptote/asymptote.spec +++ b/graphics/asymptote/asymptote.spec @@ -3,7 +3,7 @@ %global __python %{__python3} Name: asymptote -Version: 2.80 +Version: 2.82 Release: 1%{?dist} Summary: Descriptive vector graphics language diff --git a/graphics/asymptote/base/asy-kate.sh b/graphics/asymptote/base/asy-kate.sh index 5f482b376d..4212b1cb85 100644 --- a/graphics/asymptote/base/asy-kate.sh +++ b/graphics/asymptote/base/asy-kate.sh @@ -2,7 +2,7 @@ echo '<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE language SYSTEM "language.dtd"> <!-- based on asy-keywords.el and Highlighting file asymptote.xml by Christoph Hormann--> -<language version="1.0" kateversion="3.2.2" name="asymptote" section="Sources" extensions="*.asy" mimetype="text/x-asymptote" licence="LGPL" author="Carsten Brenner"> +<language version="1.0" kateversion="3.2.2" name="Asymptote" section="Sources" extensions="*.asy" mimetype="text/x-asymptote" licence="LGPL" author="Carsten Brenner"> <highlighting> ' > asymptote.xml @@ -122,7 +122,7 @@ echo ' <itemData name="Decimal" defStyleNum="dsDecVal"/> <itemData name="Extensions" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0"/> <itemData name="Float" defStyleNum="dsFloat"/> - <itemData name="Function" defStyleNum="dsFunction" /> + <itemData name="Function" defStyleNum="dsFunction" /> <itemData name="Hex" defStyleNum="dsBaseN"/> <itemData name="Keyword" defStyleNum="dsKeyword"/> <itemData name="Normal Text" defStyleNum="dsNormal"/> diff --git a/graphics/asymptote/base/geometry.asy b/graphics/asymptote/base/geometry.asy index 9f4be8d15c..9f0631f447 100644 --- a/graphics/asymptote/base/geometry.asy +++ b/graphics/asymptote/base/geometry.asy @@ -1556,6 +1556,11 @@ segment operator cast(line l) return segment(l.A, l.B); } +path operator ecast(segment s) +{ + return s.A -- s.B; +} + /*<asyxml><operator type = "line" signature="*(transform,line)"><code></asyxml>*/ line operator *(transform t, line l) {/*<asyxml></code><documentation>Provide transform * line</documentation></operator></asyxml>*/ @@ -3738,6 +3743,17 @@ void draw(picture pic = currentpicture, Label L = "", circle c, else draw(pic, L, (path)c, align, p, arrow, bar, margin, legend, marker); } +void fill(picture pic = currentpicture, circle c, pen p = currentpen) +{ + if (!degenerate(c)) fill(pic, (path)c, p); +} + +void filldraw(picture pic = currentpicture, circle c, pen fillpen = currentpen, pen drawpen = currentpen) +{ + fill(pic, c, fillpen); + draw(pic, c, drawpen); +} + /*<asyxml><function type="void" signature="draw(picture,Label,ellipse,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", ellipse el, align align = NoAlign, pen p = currentpen, @@ -3748,6 +3764,17 @@ void draw(picture pic = currentpicture, Label L = "", ellipse el, else draw(pic, L, (path)el, align, p, arrow, bar, margin, legend, marker); } +void fill(picture pic = currentpicture, ellipse el, pen p = currentpen) +{ + if (!degenerate(el)) fill(pic, (path)el, p); +} + +void filldraw(picture pic = currentpicture, ellipse el, pen fillpen = currentpen, pen drawpen = currentpen) +{ + fill(pic, el, fillpen); + draw(pic, el, drawpen); +} + /*<asyxml><function type="void" signature="draw(picture,Label,parabola,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, Label L = "", parabola parabola, align align = NoAlign, pen p = currentpen, @@ -5383,8 +5410,8 @@ void dot(picture pic = currentpicture, Label L, explicit mass M, align align = N // *=======================================================* // *.......................TRIANGLES.......................* -/*<asyxml><function type="point" signature="orthocentercenter(point,point,point)"><code></asyxml>*/ -point orthocentercenter(point A, point B, point C) +/*<asyxml><function type="point" signature="orthocenter(point,point,point)"><code></asyxml>*/ +point orthocenter(point A, point B, point C) {/*<asyxml></code><documentation>Return the orthocenter of the triangle ABC.</documentation></function></asyxml>*/ point[] P = standardizecoordsys(A, B, C); coordsys R = P[0].coordsys; @@ -5539,9 +5566,9 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ real gamma() {return degrees(acos((a()^2 + b()^2 - c()^2)/(2a() * b())));} /*<asyxml><method type = "path" signature="Path()"><code></asyxml>*/ - path Path() + path Path() // retained for backward compatibility {/*<asyxml></code><documentation>The path of the triangle.</documentation></method></asyxml>*/ - return A--C--B--cycle; + return A--B--C--cycle; } /*<asyxml><struct signature="side"><code></asyxml>*/ @@ -5584,6 +5611,8 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/ }/*<asyxml></struct></asyxml>*/ +path operator cast(triangle t) { return t.A -- t.B -- t.C -- cycle; } + from triangle unravel side; // The structure 'side' is now available outside the triangle structure. from triangle unravel vertex; // The structure 'vertex' is now available outside the triangle structure. @@ -5715,10 +5744,10 @@ line altitude(side side) return altitude(opposite(side)); } -/*<asyxml><function type="point" signature="orthocentercenter(triangle)"><code></asyxml>*/ -point orthocentercenter(triangle t) +/*<asyxml><function type="point" signature="orthocenter(triangle)"><code></asyxml>*/ +point orthocenter(triangle t) {/*<asyxml></code><documentation>Return the orthocenter of the triangle t.</documentation></function></asyxml>*/ - return orthocentercenter(t.A, t.B, t.C); + return orthocenter(t.A, t.B, t.C); } /*<asyxml><function type="point" signature="centroid(triangle)"><code></asyxml>*/ @@ -6276,13 +6305,34 @@ void show(picture pic = currentpicture, /*<asyxml><function type="void" signature="draw(picture,triangle,pen,marker)"><code></asyxml>*/ void draw(picture pic = currentpicture, triangle t, pen p = currentpen, marker marker = nomarker) {/*<asyxml></code><documentation>Draw sides of the triangle 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/ - draw(pic, t.Path(), p, marker); + draw(pic, (path)t, p, marker); +} + +void fill(picture pic = currentpicture, triangle t, pen p = currentpen) +{ + fill(pic, (path)t, p); +} + +void filldraw(picture pic = currentpicture, triangle t, pen fillpen = currentpen, pen drawpen = currentpen) +{ + fill(pic, t, fillpen); + draw(pic, t, drawpen); } /*<asyxml><function type="void" signature="draw(picture,triangle[],pen,marker)"><code></asyxml>*/ -void draw(picture pic = currentpicture, triangle[] t, pen p = currentpen, marker marker = nomarker) +void draw(picture pic = currentpicture, triangle[] ts, pen p = currentpen, marker marker = nomarker) {/*<asyxml></code><documentation>Draw sides of the triangles 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/ - for(int i = 0; i < t.length; ++i) draw(pic, t[i], p, marker); + for(triangle t: ts) draw(pic, t, p, marker); +} + +void fill(picture pic = currentpicture, triangle[] ts, pen p = currentpen) +{ + for(triangle t: ts) fill(pic, t, p); +} + +void filldraw(picture pic = currentpicture, triangle[] ts, pen fillpen = currentpen, pen drawpen = currentpen) +{ + for(triangle t: ts) filldraw(pic, t, fillpen, drawpen); } /*<asyxml><function type="void" signature="drawline(picture,triangle,pen)"><code></asyxml>*/ @@ -7192,9 +7242,18 @@ path arc(explicit pair B, explicit pair A, explicit pair C, real r) return arc(A, abs(r), BA, CA, (r < 0) ^ ((BA-CA) % 360 < 180) ? CW : CCW); } +point orthocentercenter(point A, point B, point C) +{ + return orthocenter(A, B, C); +} + +point orthocentercenter(triangle t) +{ + return orthocenter(t.A, t.B, t.C); +} + // *.......End of compatibility routines........* // *=======================================================* // *........................FOOTER.........................* // *=======================================================* - diff --git a/graphics/asymptote/base/plain.asy b/graphics/asymptote/base/plain.asy index cac6aa0722..084fedd758 100644 --- a/graphics/asymptote/base/plain.asy +++ b/graphics/asymptote/base/plain.asy @@ -171,7 +171,7 @@ string[] reverse(string[] a) {return a[reverse(a.length)];} real[] uniform(real a, real b, int n) { if(n <= 0) return new real[]; - return a+(b-a)/n*sequence(n+1); + return a+sequence(n+1)/n*(b-a); } void eval(string s, bool embedded=false) @@ -264,7 +264,7 @@ struct cputime { cputime cputime() { static processtime last; - real [] a=_cputime(); + real[] a=_cputime(); cputime cputime; real clock=a[4]; cputime.parent.user=a[0]; @@ -302,6 +302,34 @@ void write(string s="", cputime c, string format=cputimeformat, write(stdout,s,c,format,suffix); } +struct realschur { + real[][] U; + real[][] T; +} + +realschur schur(real[][] a) +{ + real[][][] S=_schur(a); + realschur schur; + schur.U=S[0]; + schur.T=S[1]; + return schur; +} + +struct schur { + pair[][] U; + pair[][] T; +} + +schur schur(pair[][] a) +{ + pair[][][] S=_schur(a); + schur schur; + schur.U=S[0]; + schur.T=S[1]; + return schur; +} + if(settings.autoimport != "") { string s=settings.autoimport; settings.autoimport=""; diff --git a/graphics/asymptote/base/plain_arrows.asy b/graphics/asymptote/base/plain_arrows.asy index 79ee403af3..a172a0d07f 100644 --- a/graphics/asymptote/base/plain_arrows.asy +++ b/graphics/asymptote/base/plain_arrows.asy @@ -53,39 +53,39 @@ path arrowbase(path r, pair y, real t, real size) arrowhead DefaultHead; DefaultHead.head=new path(path g, position position=EndPoint, pen p=currentpen, real size=0, real angle=arrowangle) { - if(size == 0) size=DefaultHead.size(p); - bool relative=position.relative; - real position=position.position.x; - if(relative) position=reltime(g,position); - path r=subpath(g,position,0); - pair x=point(r,0); - real t=arctime(r,size); - pair y=point(r,t); - path base=arrowbase(r,y,t,size); - path left=rotate(-angle,x)*r; - path right=rotate(angle,x)*r; - real[] T=arrowbasepoints(base,left,right); - pair denom=point(right,T[1])-y; - real factor=denom != 0 ? length((point(left,T[0])-y)/denom) : 1; - path left=rotate(-angle*factor,x)*r; - path right=rotate(angle*factor,x)*r; - real[] T=arrowbasepoints(base,left,right); - return subpath(left,0,T[0])--subpath(right,T[1],0)&cycle; + if(size == 0) size=DefaultHead.size(p); + bool relative=position.relative; + real position=position.position.x; + if(relative) position=reltime(g,position); + path r=subpath(g,position,0); + pair x=point(r,0); + real t=arctime(r,size); + pair y=point(r,t); + path base=arrowbase(r,y,t,size); + path left=rotate(-angle,x)*r; + path right=rotate(angle,x)*r; + real[] T=arrowbasepoints(base,left,right); + pair denom=point(right,T[1])-y; + real factor=denom != 0 ? length((point(left,T[0])-y)/denom) : 1; + path left=rotate(-angle*factor,x)*r; + path right=rotate(angle*factor,x)*r; + real[] T=arrowbasepoints(base,left,right); + return subpath(left,0,T[0])--subpath(right,T[1],0)&cycle; }; arrowhead SimpleHead; SimpleHead.head=new path(path g, position position=EndPoint, pen p=currentpen, real size=0, real angle=arrowangle) { - if(size == 0) size=SimpleHead.size(p); - bool relative=position.relative; - real position=position.position.x; - if(relative) position=reltime(g,position); - path r=subpath(g,position,0); - pair x=point(r,0); - real t=arctime(r,size); - path left=rotate(-angle,x)*r; - path right=rotate(angle,x)*r; - return subpath(left,t,0)--subpath(right,0,t); + if(size == 0) size=SimpleHead.size(p); + bool relative=position.relative; + real position=position.position.x; + if(relative) position=reltime(g,position); + path r=subpath(g,position,0); + pair x=point(r,0); + real t=arctime(r,size); + path left=rotate(-angle,x)*r; + path right=rotate(angle,x)*r; + return subpath(left,t,0)--subpath(right,0,t); }; arrowhead HookHead(real dir=arrowdir, real barb=arrowbarb) @@ -94,34 +94,34 @@ arrowhead HookHead(real dir=arrowdir, real barb=arrowbarb) a.head=new path(path g, position position=EndPoint, pen p=currentpen, real size=0, real angle=arrowangle) { - if(size == 0) size=a.size(p); - angle=min(angle*arrowhookfactor,45); - bool relative=position.relative; - real position=position.position.x; - if(relative) position=reltime(g,position); - path r=subpath(g,position,0); - pair x=point(r,0); - real t=arctime(r,size); - pair y=point(r,t); - path base=arrowbase(r,y,t,size); - path left=rotate(-angle,x)*r; - path right=rotate(angle,x)*r; - real[] T=arrowbasepoints(base,left,right,1); - pair denom=point(right,T[1])-y; - real factor=denom != 0 ? length((point(left,T[0])-y)/denom) : 1; - path left=rotate(-angle*factor,x)*r; - path right=rotate(angle*factor,x)*r; - real[] T=arrowbasepoints(base,left,right,1); - left=subpath(left,0,T[0]); - right=subpath(right,T[1],0); - pair pl0=point(left,0), pl1=relpoint(left,1); - pair pr0=relpoint(right,0), pr1=relpoint(right,1); - pair M=(pl1+pr0)/2; - pair v=barb*unit(M-pl0); - pl1=pl1+v; pr0=pr0+v; - left=pl0{dir(-dir+degrees(M-pl0,false))}..pl1--M; - right=M--pr0..pr1{dir(dir+degrees(pr1-M,false))}; - return left--right&cycle; + if(size == 0) size=a.size(p); + angle=min(angle*arrowhookfactor,45); + bool relative=position.relative; + real position=position.position.x; + if(relative) position=reltime(g,position); + path r=subpath(g,position,0); + pair x=point(r,0); + real t=arctime(r,size); + pair y=point(r,t); + path base=arrowbase(r,y,t,size); + path left=rotate(-angle,x)*r; + path right=rotate(angle,x)*r; + real[] T=arrowbasepoints(base,left,right,1); + pair denom=point(right,T[1])-y; + real factor=denom != 0 ? length((point(left,T[0])-y)/denom) : 1; + path left=rotate(-angle*factor,x)*r; + path right=rotate(angle*factor,x)*r; + real[] T=arrowbasepoints(base,left,right,1); + left=subpath(left,0,T[0]); + right=subpath(right,T[1],0); + pair pl0=point(left,0), pl1=relpoint(left,1); + pair pr0=relpoint(right,0), pr1=relpoint(right,1); + pair M=(pl1+pr0)/2; + pair v=barb*unit(M-pl0); + pl1=pl1+v; pr0=pr0+v; + left=pl0{dir(-dir+degrees(M-pl0,false))}..pl1--M; + right=M--pr0..pr1{dir(dir+degrees(pr1-M,false))}; + return left--right&cycle; }; return a; } @@ -130,34 +130,34 @@ arrowhead HookHead=HookHead(); arrowhead TeXHead; TeXHead.size=new real(pen p) { - static real hcoef=2.1; // 84/40=abs(base-hint)/base_height - return hcoef*arrowtexfactor*linewidth(p); + static real hcoef=2.1; // 84/40=abs(base-hint)/base_height + return hcoef*arrowtexfactor*linewidth(p); }; TeXHead.arcsize=TeXHead.size; TeXHead.head=new path(path g, position position=EndPoint, pen p=currentpen, real size=0, real angle=arrowangle) { - static real wcoef=1/84; // 1/abs(base-hint) - static path texhead=scale(wcoef)* - ((0,20) .. controls (-75,75) and (-108,158) .. - (-108,166) .. controls (-108,175) and (-100,178) .. - (-93,178) .. controls (-82,178) and (-80,173) .. - (-77,168) .. controls (-62,134) and (-30,61) .. - (70,14) .. controls (82,8) and (84,7) .. - (84,0) .. controls (84,-7) and (82,-8) .. - (70,-14) .. controls (-30,-61) and (-62,-134) .. - (-77,-168) .. controls (-80,-173) and (-82,-178) .. - (-93,-178) .. controls (-100,-178) and (-108,-175).. - (-108,-166).. controls (-108,-158) and (-75,-75) .. - (0,-20)--cycle); - if(size == 0) size=TeXHead.size(p); - path gp=scale(size)*texhead; - bool relative=position.relative; - real position=position.position.x; - if(relative) position=reltime(g,position); - path r=subpath(g,position,0); - pair y=point(r,arctime(r,size)); - return shift(y)*rotate(degrees(-dir(r,arctime(r,0.5*size))))*gp; + static real wcoef=1/84; // 1/abs(base-hint) + static path texhead=scale(wcoef)* + ((0,20) .. controls (-75,75) and (-108,158) .. + (-108,166) .. controls (-108,175) and (-100,178) .. + (-93,178) .. controls (-82,178) and (-80,173) .. + (-77,168) .. controls (-62,134) and (-30,61) .. + (70,14) .. controls (82,8) and (84,7) .. + (84,0) .. controls (84,-7) and (82,-8) .. + (70,-14) .. controls (-30,-61) and (-62,-134) .. + (-77,-168) .. controls (-80,-173) and (-82,-178) .. + (-93,-178) .. controls (-100,-178) and (-108,-175).. + (-108,-166).. controls (-108,-158) and (-75,-75) .. + (0,-20)--cycle); + if(size == 0) size=TeXHead.size(p); + path gp=scale(size)*texhead; + bool relative=position.relative; + real position=position.position.x; + if(relative) position=reltime(g,position); + path r=subpath(g,position,0); + pair y=point(r,arctime(r,size)); + return shift(y)*rotate(degrees(-dir(r,arctime(r,0.5*size))))*gp; }; TeXHead.defaultfilltype=new filltype(pen p) {return Fill(p);}; diff --git a/graphics/asymptote/base/shaders/blend.glsl b/graphics/asymptote/base/shaders/blend.glsl index 8a656e06c9..2db4f30abe 100644 --- a/graphics/asymptote/base/shaders/blend.glsl +++ b/graphics/asymptote/base/shaders/blend.glsl @@ -1,31 +1,14 @@ layout(binding=0, std430) buffer offsetBuffer { + uint maxDepth; uint offset[]; }; -#ifdef GPUINDEXING -uniform uint elements; -uniform uint offset2; -uniform uint m1; -uniform uint m2; -uniform uint r; - -layout(binding=2, std430) buffer localSumBuffer -{ - uint localSum[]; -}; - -layout(binding=3, std430) buffer globalSumBuffer -{ - uint globalSum[]; -}; -#define count offset -#else layout(binding=2, std430) buffer countBuffer { + uint maxSize; uint count[]; }; -#endif layout(binding=4, std430) buffer fragmentBuffer { @@ -42,7 +25,6 @@ layout(binding=6, std430) buffer opaqueBuffer { }; layout(binding=7, std430) buffer opaqueDepthBuffer { - uint maxSize; float opaqueDepth[]; }; @@ -82,7 +64,12 @@ void main() } #endif +#ifdef GPUINDEXING + uint listIndex=offset[element]; + uint size=offset[element+1u]-listIndex; +#else uint size=count[element]; +#endif #ifndef GPUCOMPRESS if(size == 0u) { @@ -94,11 +81,7 @@ void main() outColor=OpaqueDepth != 0.0 ? opaqueColor[pixel] : background; -#ifdef GPUINDEXING - uint p=element < r*(m1+1u) ? element/(m1+1u) : (element-r)/m1; - uint listIndex=localSum[p]+localSum[offset2+p/m2]+globalSum[p/(m2*m2)]+ - offset[elements+element]; -#else +#ifndef GPUINDEXING uint listIndex=offset[element]-size; #endif @@ -146,9 +129,9 @@ void main() if(OpaqueDepth != 0.0) opaqueDepth[pixel]=0.0; } else { - atomicMax(maxSize,size); + atomicMax(maxDepth,size); #ifndef GPUINDEXING - count[0]=maxSize; + maxSize=maxDepth; #endif for(uint i=k+1u; i < size; i++) { vec4 temp=fragment[listIndex+i]; diff --git a/graphics/asymptote/base/shaders/compress.glsl b/graphics/asymptote/base/shaders/compress.glsl index 2f64d24c88..26b4e1041e 100644 --- a/graphics/asymptote/base/shaders/compress.glsl +++ b/graphics/asymptote/base/shaders/compress.glsl @@ -1,16 +1,3 @@ -#ifdef GPUINDEXING -layout(binding=0, std430) buffer offsetBuffer -{ - uint offset[]; -}; -#define count offset -#else -layout(binding=2, std430) buffer countBuffer -{ - uint count[]; -}; -#endif - layout(binding=0) uniform atomic_uint elements; layout(binding=1, std430) buffer indexBuffer @@ -18,6 +5,12 @@ layout(binding=1, std430) buffer indexBuffer uint index[]; }; +layout(binding=2, std430) buffer countBuffer +{ + uint maxSize; + uint count[]; +}; + uniform uint width; void main() diff --git a/graphics/asymptote/base/shaders/count.glsl b/graphics/asymptote/base/shaders/count.glsl index bd06331d77..f64b25ed44 100644 --- a/graphics/asymptote/base/shaders/count.glsl +++ b/graphics/asymptote/base/shaders/count.glsl @@ -1,15 +1,15 @@ #ifdef GPUCOMPRESS layout(binding=1, std430) buffer indexBuffer -#else -#ifdef GPUINDEXING -layout(binding=0, std430) buffer offsetBuffer +{ + uint index[]; +}; #else layout(binding=2, std430) buffer countBuffer -#endif -#endif { + uint maxSize; uint index[]; }; +#endif uniform uint width; diff --git a/graphics/asymptote/base/shaders/fragment.glsl b/graphics/asymptote/base/shaders/fragment.glsl index 79f2573402..6f42f7d491 100644 --- a/graphics/asymptote/base/shaders/fragment.glsl +++ b/graphics/asymptote/base/shaders/fragment.glsl @@ -32,29 +32,14 @@ float Roughness; layout(binding=0, std430) buffer offsetBuffer { + uint maxDepth; uint offset[]; }; -#ifdef GPUINDEXING -#if defined(TRANSPARENT) || (!defined(HAVE_INTERLOCK) && !defined(OPAQUE)) -uniform uint elements; -uniform uint offset2; -uniform uint m1; -uniform uint m2; -uniform uint r; -#endif -layout(binding=2, std430) buffer localSumBuffer -{ - uint localSum[]; -}; - -layout(binding=3, std430) buffer globalSumBuffer -{ - uint globalSum[]; -}; -#else +#ifndef GPUINDEXING layout(binding=2, std430) buffer countBuffer { + uint maxSize; uint count[]; }; #endif @@ -76,7 +61,6 @@ layout(binding=6, std430) buffer opaqueBuffer layout(binding=7, std430) buffer opaqueDepthBuffer { - uint maxSize; float opaqueDepth[]; }; @@ -294,9 +278,7 @@ void main() #if defined(TRANSPARENT) || (!defined(HAVE_INTERLOCK) && !defined(OPAQUE)) uint element=INDEX(pixel); #ifdef GPUINDEXING - uint p=element < r*(m1+1u) ? element/(m1+1u) : (element-r)/m1; - uint listIndex=localSum[p]+localSum[offset2+p/m2]+globalSum[p/(m2*m2)]+ - atomicAdd(offset[elements+element],-1u)-1u; + uint listIndex=atomicAdd(offset[element],-1u)-1u; #else uint listIndex=offset[element]-atomicAdd(count[element],1u)-1u; #endif diff --git a/graphics/asymptote/base/shaders/sum1.glsl b/graphics/asymptote/base/shaders/sum1.glsl index f1fa8454b0..e54744a1d4 100644 --- a/graphics/asymptote/base/shaders/sum1.glsl +++ b/graphics/asymptote/base/shaders/sum1.glsl @@ -1,36 +1,40 @@ -layout(local_size_x=LOCAL_SIZE_X) in; +layout(local_size_x=LOCALSIZE) in; + +const uint groupSize=LOCALSIZE*BLOCKSIZE; uniform uint elements; -layout(binding=0, std430) buffer offsetBuffer +layout(binding=2, std430) buffer countBuffer { - uint offset[]; + uint maxSize; + uint count[]; }; -layout(binding=2, std430) buffer localSumBuffer +layout(binding=3, std430) buffer globalSumBuffer { - uint localSum[]; + uint globalSum[]; }; -void main(void) +shared uint groupSum[LOCALSIZE]; + +void main() { - uint id=gl_GlobalInvocationID.x; - - uint m=elements/(gl_WorkGroupSize.x*gl_NumWorkGroups.x); - uint r=elements-m*gl_WorkGroupSize.x*gl_NumWorkGroups.x; - uint row,stop; - if(id < r) { - row=m*id+id; - stop=row+m+1u; - } else { - row=m*id+r; - stop=row+m; - } + uint id=gl_LocalInvocationID.x; + uint dataOffset=gl_WorkGroupID.x*groupSize+id; + uint stop=dataOffset+groupSize; + uint sum=0u; + for(uint i=dataOffset; i < stop; i += LOCALSIZE) + sum += count[i]; - uint Sum=offset[row]; - offset[elements+row]=Sum; - for(uint i=row+1u; i < stop; ++i) - offset[elements+i]=Sum += offset[i]; + groupSum[id]=sum; + barrier(); + + for(uint s=LOCALSIZE/2; s > 0u; s >>= 1u) { + if(id < s) + groupSum[id] += groupSum[id+s]; + barrier(); + } - localSum[id+1u]=Sum; + if(id == 0u) + globalSum[gl_WorkGroupID.x]=groupSum[0u]; } diff --git a/graphics/asymptote/base/shaders/sum2.glsl b/graphics/asymptote/base/shaders/sum2.glsl index 11bf0064eb..17b5efeaee 100644 --- a/graphics/asymptote/base/shaders/sum2.glsl +++ b/graphics/asymptote/base/shaders/sum2.glsl @@ -1,22 +1,43 @@ -layout(local_size_x=LOCAL_SIZE_X) in; +layout(local_size_x=LOCALSIZE) in; -uniform uint offset2; +const uint groupSize=LOCALSIZE*BLOCKSIZE; -layout(binding=2, std430) buffer localSumBuffer +uniform uint blockSize; + +layout(binding=3, std430) buffer globalSumBuffer { - uint localSum[]; + uint globalSum[]; }; -void main(void) +shared uint groupSum[LOCALSIZE]; + +void main() { - uint id=gl_GlobalInvocationID.x; + uint localSum[groupSize]; + uint id=gl_LocalInvocationID.x; + + uint dataOffset=blockSize*id; + uint sum=0u; + for(uint i=0; i < blockSize; ++i) { + localSum[i]=sum; + sum += globalSum[dataOffset+i]; + } - uint row=LOCAL_SIZE_X*id; - uint stop=row+LOCAL_SIZE_X; + groupSum[id]=sum; + barrier(); - uint Sum=localSum[row]; - for(uint i=row+1u; i < stop; ++i) - localSum[i]=Sum += localSum[i]; + for(uint shift=1u; shift < LOCALSIZE; shift *= 2u) { + uint read; + if(shift <= id) + read=groupSum[id]+groupSum[id-shift]; + barrier(); + if(shift <= id) + groupSum[id]=read; + barrier(); + } - localSum[offset2+id+1u]=Sum; + // shift local sums and store + uint shift=id > 0u ? groupSum[id-1u] : 0u; + for(uint i=0u; i < blockSize; ++i) + globalSum[dataOffset+i]=localSum[i]+shift; } diff --git a/graphics/asymptote/base/shaders/sum2fast.glsl b/graphics/asymptote/base/shaders/sum2fast.glsl new file mode 100644 index 0000000000..d0c93c0957 --- /dev/null +++ b/graphics/asymptote/base/shaders/sum2fast.glsl @@ -0,0 +1,59 @@ +layout(local_size_x=LOCALSIZE) in; + +const uint groupSize=LOCALSIZE*BLOCKSIZE; + +layout(binding=3, std430) buffer globalSumBuffer +{ + uint globalSum[]; +}; + +layout(binding=8, std430) buffer feedbackBuffer +{ + uint maxSize; + uint fragments; +}; + +shared uint shuffle[groupSize+LOCALSIZE-1u]; +shared uint groupSum[LOCALSIZE+1u]; + +void main() +{ + uint id=gl_LocalInvocationID.x; + +// avoid bank conflicts and coalesce global memory accesses + uint shuffleOffset=id/BLOCKSIZE+id; + const uint stride=LOCALSIZE/BLOCKSIZE+LOCALSIZE; + for(uint i=0u; i < BLOCKSIZE; i++) + shuffle[shuffleOffset+i*stride]=globalSum[id+i*LOCALSIZE]; + + barrier(); + + uint Offset=id*BLOCKSIZE+id; + uint stop=Offset+BLOCKSIZE; + uint sum=0u; + for(uint i=Offset; i < stop; ++i) { + uint value=shuffle[i]; + shuffle[i]=sum; + sum += value; + } + + if(id == 0u) + groupSum[0u]=0u; + groupSum[id+1u]=sum; + barrier(); + + // Apply Hillis-Steele algorithm over all sums in workgroup + for(uint shift=1u; shift < LOCALSIZE; shift *= 2u) { + uint read; + if(shift <= id) + read=groupSum[id]+groupSum[id-shift]; + barrier(); + if(shift <= id) + groupSum[id]=read; + barrier(); + } + + for(uint i=0u; i < BLOCKSIZE; i++) + globalSum[id+i*LOCALSIZE]= + shuffle[shuffleOffset+i*stride]+groupSum[(i*LOCALSIZE+id)/BLOCKSIZE]; +} diff --git a/graphics/asymptote/base/shaders/sum3.glsl b/graphics/asymptote/base/shaders/sum3.glsl index 8e6e94bf45..4ee5203060 100644 --- a/graphics/asymptote/base/shaders/sum3.glsl +++ b/graphics/asymptote/base/shaders/sum3.glsl @@ -1,11 +1,19 @@ -layout(local_size_x=LOCAL_SIZE_X) in; +layout(local_size_x=LOCALSIZE) in; + +const uint groupSize=LOCALSIZE*BLOCKSIZE; -uniform uint offset2; uniform uint final; -layout(binding=2, std430) buffer localSumBuffer +layout(binding=0, std430) buffer offsetBuffer +{ + uint maxDepth; + uint offset[]; +}; + +layout(binding=2, std430) buffer countBuffer { - uint localSum[]; + uint maxSize; + uint count[]; }; layout(binding=3, std430) buffer globalSumBuffer @@ -13,27 +21,60 @@ layout(binding=3, std430) buffer globalSumBuffer uint globalSum[]; }; -layout(binding=7, std430) buffer opaqueDepthBuffer +layout(binding=8, std430) buffer feedbackBuffer { - uint maxSize; - float opaqueDepth[]; + uint size; + uint fragments; }; -void main(void) +shared uint shuffle[groupSize+LOCALSIZE-1u]; +shared uint groupSum[LOCALSIZE+1u]; + +void main() { - uint id=gl_GlobalInvocationID.x; - uint row=offset2+LOCAL_SIZE_X*id; - uint stop=row+LOCAL_SIZE_X; - - uint Sum=localSum[row]; - for(uint i=row+1u; i < stop; ++i) - localSum[i]=Sum += localSum[i]; - - uint id1=id+1u; - if(id1 < gl_WorkGroupSize.x*gl_NumWorkGroups.x) - globalSum[id1]=Sum; - else { - globalSum[0]=maxSize; - globalSum[id1]=Sum+localSum[offset2-1u]+localSum[final]; + uint id=gl_LocalInvocationID.x; + +// avoid bank conflicts and coalesce global memory accesses + uint dataOffset=gl_WorkGroupID.x*groupSize+id; + uint shuffleOffset=id/BLOCKSIZE+id; + const uint stride=LOCALSIZE/BLOCKSIZE+LOCALSIZE; + for(uint i=0u; i < BLOCKSIZE; i++) + shuffle[shuffleOffset+i*stride]=count[dataOffset+i*LOCALSIZE]; + + barrier(); + + uint Offset=id*BLOCKSIZE+id; + uint stop=Offset+BLOCKSIZE; + + uint sum=0u; + for(uint i=Offset; i < stop; ++i) + shuffle[i]=sum += shuffle[i]; + + if(id == 0u) + groupSum[0u]=0u; + groupSum[id+1u]=sum; + barrier(); + + // Apply Hillis-Steele algorithm over all sums in workgroup + for(uint shift=1u; shift < LOCALSIZE; shift *= 2u) { + uint read; + if(shift <= id) + read=groupSum[id]+groupSum[id-shift]; + barrier(); + if(shift <= id) + groupSum[id]=read; + barrier(); + } + + uint groupOffset=globalSum[gl_WorkGroupID.x]; + for(uint i=0u; i < BLOCKSIZE; ++i) + offset[dataOffset+i*LOCALSIZE]=shuffle[shuffleOffset+i*stride]+ + groupSum[(i*LOCALSIZE+id)/BLOCKSIZE]+groupOffset; + + uint diff=final-dataOffset; + if(diff < groupSize && diff % LOCALSIZE == 0) { + size=maxDepth; + maxDepth=0u; + fragments=offset[final+1u]=offset[final]; } } diff --git a/graphics/asymptote/base/shaders/zero.glsl b/graphics/asymptote/base/shaders/zero.glsl index 747f44b3bc..06a5359e6d 100644 --- a/graphics/asymptote/base/shaders/zero.glsl +++ b/graphics/asymptote/base/shaders/zero.glsl @@ -1,5 +1,6 @@ layout(binding=2, std430) buffer countBuffer { + uint maxSize; uint count[]; }; diff --git a/graphics/asymptote/base/three_surface.asy b/graphics/asymptote/base/three_surface.asy index 95f41a6181..04f269f73f 100644 --- a/graphics/asymptote/base/three_surface.asy +++ b/graphics/asymptote/base/three_surface.asy @@ -1384,7 +1384,8 @@ void draw3D(frame f, patch s, material m, if(prc() && light.on()) straight=false; // PRC vertex colors (for quads only) ignore lighting m=material(m); - m.diffuse(mean(s.colors)); + if(prc()) + m.diffuse(mean(s.colors)); } m=material(m,light,s.colors.length > 0); @@ -1423,7 +1424,7 @@ void draw(frame f, triple[] v, int[][] vi, triple[] n={}, int[][] ni={}, material m=currentpen, pen[] p={}, int[][] pi={}, light light=currentlight, render render=defaultrender) { - bool normals=n.length > 0; + bool normals=ni.length > 0; if(!normals) { ni=new int[vi.length][3]; normals=computeNormals(v,vi,n,ni) > 0; @@ -1431,6 +1432,35 @@ void draw(frame f, triple[] v, int[][] vi, if(p.length > 0) m=mean(p); m=material(m,light); + + if(prc()) { + int[] vertexNormal=new int[ni.length]; + int[] vertexPen=new int[pi.length]; + + bool pens=pi.length > 0; + + for(int i=0; i < vi.length; ++i) { + int[] vii=vi[i]; + int[] nii=ni[i]; + for(int j=0; j < 3; ++j) { + int V=vii[j]; + vertexNormal[V]=nii[j]; + if(pens) + vertexPen[V]=pi[i][j]; + } + } + + for(int i=0; i < vi.length; ++i) { + int[] vii=vi[i]; + for(int j=0; j < 3; ++j) { + int V=vii[j]; + ni[i][j]=vertexNormal[V]; + if(pens) + pi[i][j]=vertexPen[V]; + } + } + } + draw(f,v,vi,render.interaction.center,n,ni, m.p,m.opacity,m.shininess,m.metallic,m.fresnel0,p,pi, render.interaction.type); @@ -1441,8 +1471,7 @@ void draw(picture pic=currentpicture, triple[] v, int[][] vi, triple[] n={}, int[][] ni={}, material m=currentpen, pen[] p={}, int[][] pi={}, light light=currentlight, render render=defaultrender) { - bool prc=prc(); - bool normals=n.length > 0; + bool normals=ni.length > 0; if(!normals) { ni=new int[vi.length][3]; normals=computeNormals(v,vi,n,ni) > 0; diff --git a/graphics/asymptote/base/v3dheadertypes.asy b/graphics/asymptote/base/v3dheadertypes.asy index 96da507ec8..2beb9608d8 100644 --- a/graphics/asymptote/base/v3dheadertypes.asy +++ b/graphics/asymptote/base/v3dheadertypes.asy @@ -1,6 +1,6 @@ // Enum class for v3dheadertypes // AUTO-GENERATED from v3dheadertypes.csv -// Generated at 2022-04-05 20:52:21.949166 +// Generated at 2022-08-06 23:21:24.974497 struct v3dheadertypes { diff --git a/graphics/asymptote/base/v3dtypes.asy b/graphics/asymptote/base/v3dtypes.asy index b3d11e2e68..e578ef51da 100644 --- a/graphics/asymptote/base/v3dtypes.asy +++ b/graphics/asymptote/base/v3dtypes.asy @@ -1,6 +1,6 @@ // Enum class for v3dtypes // AUTO-GENERATED from v3dtypes.csv -// Generated at 2022-04-05 20:52:21.903691 +// Generated at 2022-08-06 23:21:24.890912 struct v3dtypes { diff --git a/graphics/asymptote/base/webgl/asygl.js b/graphics/asymptote/base/webgl/asygl.js index f33ee3ef54..4de87cda58 100644 --- a/graphics/asymptote/base/webgl/asygl.js +++ b/graphics/asymptote/base/webgl/asygl.js @@ -36,4 +36,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/ -let vertex="\n#ifdef WEBGL2\n#define IN in\n#define OUT out\n#else\n#define IN attribute\n#define OUT varying\n#endif\n\nIN vec3 position;\n#ifdef WIDTH\nIN float width;\n#endif\n#ifdef NORMAL\nIN vec3 normal;\n#endif\n\nIN float materialIndex;\n\n#ifdef WEBGL2\nflat out int MaterialIndex;\n#ifdef COLOR\nOUT vec4 Color;\n#endif\n\n#else\nOUT vec4 diffuse;\nOUT vec3 specular;\nOUT float roughness,metallic,fresnel0;\nOUT vec4 emissive;\n\nstruct Material {\n vec4 diffuse,emissive,specular;\n vec4 parameters;\n};\n\nuniform Material Materials[Nmaterials];\n#endif\n\n#ifdef COLOR\nIN vec4 color;\n#endif\n\nuniform mat3 normMat;\nuniform mat4 viewMat;\nuniform mat4 projViewMat;\n\n#ifdef NORMAL\n#ifndef ORTHOGRAPHIC\nOUT vec3 ViewPosition;\n#endif\nOUT vec3 Normal;\n#endif\n\nvoid main(void)\n{\n vec4 v=vec4(position,1.0);\n gl_Position=projViewMat*v;\n\n#ifdef NORMAL\n#ifndef ORTHOGRAPHIC\n ViewPosition=(viewMat*v).xyz;\n#endif\n Normal=normalize(normal*normMat);\n#endif\n\n#ifdef WEBGL2\n MaterialIndex=int(materialIndex);\n#ifdef COLOR\n Color=color;\n#endif\n#else\n#ifdef NORMAL\n Material m;\n#ifdef TRANSPARENT\n m=Materials[int(abs(materialIndex))-1];\n emissive=m.emissive;\n if(materialIndex >= 0.0)\n diffuse=m.diffuse;\n else {\n diffuse=color;\n#if nlights == 0\n emissive += color;\n#endif\n }\n#else\n m=Materials[int(materialIndex)];\n emissive=m.emissive;\n#ifdef COLOR\n diffuse=color;\n#if nlights == 0\n emissive += color;\n#endif\n#else\n diffuse=m.diffuse;\n#endif // COLOR\n#endif // TRANSPARENT\n specular=m.specular.rgb;\n vec4 parameters=m.parameters;\n roughness=1.0-parameters[0];\n metallic=parameters[1];\n fresnel0=parameters[2];\n#else\n emissive=Materials[int(materialIndex)].emissive;\n#endif // NORMAL\n#endif // WEBGL2\n\n#ifdef WIDTH\n gl_PointSize=width;\n#endif\n}\n",fragment="\n#ifdef WEBGL2\n#define IN in\nout vec4 outValue;\n#define OUTVALUE outValue\n#else\n#define IN varying\n#define OUTVALUE gl_FragColor\n#endif\n\n#ifdef WEBGL2\nflat in int MaterialIndex;\n\nstruct Material {\n vec4 diffuse,emissive,specular;\n vec4 parameters;\n};\n\nuniform Material Materials[Nmaterials];\n\nvec4 diffuse;\nvec3 specular;\nfloat roughness,metallic,fresnel0;\nvec4 emissive;\n\n#ifdef COLOR\nin vec4 Color;\n#endif\n\n#else\nIN vec4 diffuse;\nIN vec3 specular;\nIN float roughness,metallic,fresnel0;\nIN vec4 emissive;\n#endif\n\n#ifdef NORMAL\n\n#ifndef ORTHOGRAPHIC\nIN vec3 ViewPosition;\n#endif\nIN vec3 Normal;\n\nvec3 normal;\n\nstruct Light {\n vec3 direction;\n vec3 color;\n};\n\nuniform Light Lights[Nlights];\n\n#ifdef USE_IBL\nuniform sampler2D reflBRDFSampler;\nuniform sampler2D diffuseSampler;\nuniform sampler2D reflImgSampler;\n\nconst float pi=acos(-1.0);\nconst float piInv=1.0/pi;\nconst float twopi=2.0*pi;\nconst float twopiInv=1.0/twopi;\n\n// (x,y,z) -> (r,theta,phi);\n// theta -> [0,pi]: colatitude\n// phi -> [-pi,pi]: longitude\nvec3 cart2sphere(vec3 cart)\n{\n float x=cart.x;\n float y=cart.z;\n float z=cart.y;\n\n float r=length(cart);\n float theta=r > 0.0 ? acos(z/r) : 0.0;\n float phi=atan(y,x);\n\n return vec3(r,theta,phi);\n}\n\nvec2 normalizedAngle(vec3 cartVec)\n{\n vec3 sphericalVec=cart2sphere(cartVec);\n sphericalVec.y=sphericalVec.y*piInv;\n sphericalVec.z=0.75-sphericalVec.z*twopiInv;\n return sphericalVec.zy;\n}\n\nvec3 IBLColor(vec3 viewDir)\n{\n vec3 IBLDiffuse=diffuse.rgb*texture(diffuseSampler,normalizedAngle(normal)).rgb;\n vec3 reflectVec=normalize(reflect(-viewDir,normal));\n vec2 reflCoord=normalizedAngle(reflectVec);\n vec3 IBLRefl=textureLod(reflImgSampler,reflCoord,roughness*ROUGHNESS_STEP_COUNT).rgb;\n vec2 IBLbrdf=texture(reflBRDFSampler,vec2(dot(normal,viewDir),roughness)).rg;\n float specularMultiplier=fresnel0*IBLbrdf.x+IBLbrdf.y;\n vec3 dielectric=IBLDiffuse+specularMultiplier*IBLRefl;\n vec3 metal=diffuse.rgb*IBLRefl;\n return mix(dielectric,metal,metallic);\n}\n#else\nfloat Roughness2;\nfloat NDF_TRG(vec3 h)\n{\n float ndoth=max(dot(normal,h),0.0);\n float alpha2=Roughness2*Roughness2;\n float denom=ndoth*ndoth*(alpha2-1.0)+1.0;\n return denom != 0.0 ? alpha2/(denom*denom) : 0.0;\n}\n\nfloat GGX_Geom(vec3 v)\n{\n float ndotv=max(dot(v,normal),0.0);\n float ap=1.0+Roughness2;\n float k=0.125*ap*ap;\n return ndotv/((ndotv*(1.0-k))+k);\n}\n\nfloat Geom(vec3 v, vec3 l)\n{\n return GGX_Geom(v)*GGX_Geom(l);\n}\n\nfloat Fresnel(vec3 h, vec3 v, float fresnel0)\n{\n float a=1.0-max(dot(h,v),0.0);\n float b=a*a;\n return fresnel0+(1.0-fresnel0)*b*b*a;\n}\n\n// physical based shading using UE4 model.\nvec3 BRDF(vec3 viewDirection, vec3 lightDirection)\n{\n vec3 lambertian=diffuse.rgb;\n vec3 h=normalize(lightDirection+viewDirection);\n\n float omegain=max(dot(viewDirection,normal),0.0);\n float omegaln=max(dot(lightDirection,normal),0.0);\n\n float D=NDF_TRG(h);\n float G=Geom(viewDirection,lightDirection);\n float F=Fresnel(h,viewDirection,fresnel0);\n\n float denom=4.0*omegain*omegaln;\n float rawReflectance=denom > 0.0 ? (D*G)/denom : 0.0;\n\n vec3 dielectric=mix(lambertian,rawReflectance*specular,F);\n vec3 metal=rawReflectance*diffuse.rgb;\n\n return mix(dielectric,metal,metallic);\n}\n#endif\n\n#endif\n\nvoid main(void)\n{\n#ifdef WEBGL2\n#ifdef NORMAL\n Material m;\n#ifdef TRANSPARENT\n m=Materials[abs(MaterialIndex)-1];\n emissive=m.emissive;\n if(MaterialIndex >= 0)\n diffuse=m.diffuse;\n else {\n diffuse=Color;\n#if nlights == 0\n emissive += Color;\n#endif\n }\n#else\n m=Materials[MaterialIndex];\n emissive=m.emissive;\n#ifdef COLOR\n diffuse=Color;\n#if nlights == 0\n emissive += Color;\n#endif\n#else\n diffuse=m.diffuse;\n#endif // COLOR\n#endif // TRANSPARENT\n specular=m.specular.rgb;\n vec4 parameters=m.parameters;\n roughness=1.0-parameters[0];\n metallic=parameters[1];\n fresnel0=parameters[2];\n#else\n emissive=Materials[MaterialIndex].emissive;\n#endif // NORMAL\n#endif // WEBGL2\n\n#if defined(NORMAL) && nlights > 0\n normal=normalize(Normal);\n normal=gl_FrontFacing ? normal : -normal;\n#ifdef ORTHOGRAPHIC\n vec3 viewDir=vec3(0.0,0.0,1.0);\n#else\n vec3 viewDir=-normalize(ViewPosition);\n#endif\n\nvec3 color;\n#ifdef USE_IBL\n color=IBLColor(viewDir);\n#else\n Roughness2=roughness*roughness;\n color=emissive.rgb;\n for(int i=0; i < nlights; ++i) {\n Light Li=Lights[i];\n vec3 L=Li.direction;\n float cosTheta=max(dot(normal,L),0.0);\n vec3 radiance=cosTheta*Li.color;\n color += BRDF(viewDir,L)*radiance;\n }\n#endif\n OUTVALUE=vec4(color,diffuse.a);\n#else\n OUTVALUE=emissive;\n#endif\n}\n";!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i=t();for(var a in i)("object"==typeof exports?exports:e)[a]=i[a]}}("undefined"!=typeof self?self:this,(function(){return function(e){var t={};function i(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setMatrixArrayType=function(e){t.ARRAY_TYPE=e},t.toRadian=function(e){return e*n},t.equals=function(e,t){return Math.abs(e-t)<=a*Math.max(1,Math.abs(e),Math.abs(t))};var a=t.EPSILON=1e-6;t.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,t.RANDOM=Math.random;var n=Math.PI/180},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mat4=t.mat3=void 0;var a=r(i(2)),n=r(i(3));function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}t.mat3=a,t.mat4=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new a.ARRAY_TYPE(9);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},t.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},t.invert=function(e,t){var i=t[0],a=t[1],n=t[2],r=t[3],s=t[4],o=t[5],l=t[6],h=t[7],c=t[8],d=c*s-o*h,m=-c*r+o*l,f=h*r-s*l,u=i*d+a*m+n*f;if(!u)return null;return u=1/u,e[0]=d*u,e[1]=(-c*a+n*h)*u,e[2]=(o*a-n*s)*u,e[3]=m*u,e[4]=(c*i-n*l)*u,e[5]=(-o*i+n*r)*u,e[6]=f*u,e[7]=(-h*i+a*l)*u,e[8]=(s*i-a*r)*u,e};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(i(0))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.create=function(){var e=new a.ARRAY_TYPE(16);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.invert=function(e,t){var i=t[0],a=t[1],n=t[2],r=t[3],s=t[4],o=t[5],l=t[6],h=t[7],c=t[8],d=t[9],m=t[10],f=t[11],u=t[12],p=t[13],g=t[14],v=t[15],x=i*o-a*s,w=i*l-n*s,M=i*h-r*s,b=a*l-n*o,T=a*h-r*o,S=n*h-r*l,R=c*p-d*u,A=c*g-m*u,I=c*v-f*u,P=d*g-m*p,E=d*v-f*p,y=m*v-f*g,L=x*y-w*E+M*P+b*I-T*A+S*R;if(!L)return null;return L=1/L,e[0]=(o*y-l*E+h*P)*L,e[1]=(n*E-a*y-r*P)*L,e[2]=(p*S-g*T+v*b)*L,e[3]=(m*T-d*S-f*b)*L,e[4]=(l*I-s*y-h*A)*L,e[5]=(i*y-n*I+r*A)*L,e[6]=(g*M-u*S-v*w)*L,e[7]=(c*S-m*M+f*w)*L,e[8]=(s*E-o*I+h*R)*L,e[9]=(a*I-i*E-r*R)*L,e[10]=(u*T-p*M+v*x)*L,e[11]=(d*M-c*T-f*x)*L,e[12]=(o*A-s*P-l*R)*L,e[13]=(i*P-a*A+n*R)*L,e[14]=(p*w-u*b-g*x)*L,e[15]=(c*b-d*w+m*x)*L,e},t.multiply=n,t.translate=function(e,t,i){var a=i[0],n=i[1],r=i[2],s=void 0,o=void 0,l=void 0,h=void 0,c=void 0,d=void 0,m=void 0,f=void 0,u=void 0,p=void 0,g=void 0,v=void 0;t===e?(e[12]=t[0]*a+t[4]*n+t[8]*r+t[12],e[13]=t[1]*a+t[5]*n+t[9]*r+t[13],e[14]=t[2]*a+t[6]*n+t[10]*r+t[14],e[15]=t[3]*a+t[7]*n+t[11]*r+t[15]):(s=t[0],o=t[1],l=t[2],h=t[3],c=t[4],d=t[5],m=t[6],f=t[7],u=t[8],p=t[9],g=t[10],v=t[11],e[0]=s,e[1]=o,e[2]=l,e[3]=h,e[4]=c,e[5]=d,e[6]=m,e[7]=f,e[8]=u,e[9]=p,e[10]=g,e[11]=v,e[12]=s*a+c*n+u*r+t[12],e[13]=o*a+d*n+p*r+t[13],e[14]=l*a+m*n+g*r+t[14],e[15]=h*a+f*n+v*r+t[15]);return e},t.rotate=function(e,t,i,n){var r,s,o,l,h,c,d,m,f,u,p,g,v,x,w,M,b,T,S,R,A,I,P,E,y=n[0],L=n[1],D=n[2],O=Math.sqrt(y*y+L*L+D*D);if(Math.abs(O)<a.EPSILON)return null;y*=O=1/O,L*=O,D*=O,r=Math.sin(i),s=Math.cos(i),o=1-s,l=t[0],h=t[1],c=t[2],d=t[3],m=t[4],f=t[5],u=t[6],p=t[7],g=t[8],v=t[9],x=t[10],w=t[11],M=y*y*o+s,b=L*y*o+D*r,T=D*y*o-L*r,S=y*L*o-D*r,R=L*L*o+s,A=D*L*o+y*r,I=y*D*o+L*r,P=L*D*o-y*r,E=D*D*o+s,e[0]=l*M+m*b+g*T,e[1]=h*M+f*b+v*T,e[2]=c*M+u*b+x*T,e[3]=d*M+p*b+w*T,e[4]=l*S+m*R+g*A,e[5]=h*S+f*R+v*A,e[6]=c*S+u*R+x*A,e[7]=d*S+p*R+w*A,e[8]=l*I+m*P+g*E,e[9]=h*I+f*P+v*E,e[10]=c*I+u*P+x*E,e[11]=d*I+p*P+w*E,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]);return e},t.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e},t.fromRotation=function(e,t,i){var n,r,s,o=i[0],l=i[1],h=i[2],c=Math.sqrt(o*o+l*l+h*h);if(Math.abs(c)<a.EPSILON)return null;return o*=c=1/c,l*=c,h*=c,n=Math.sin(t),r=Math.cos(t),s=1-r,e[0]=o*o*s+r,e[1]=l*o*s+h*n,e[2]=h*o*s-l*n,e[3]=0,e[4]=o*l*s-h*n,e[5]=l*l*s+r,e[6]=h*l*s+o*n,e[7]=0,e[8]=o*h*s+l*n,e[9]=l*h*s-o*n,e[10]=h*h*s+r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},t.frustum=function(e,t,i,a,n,r,s){var o=1/(i-t),l=1/(n-a),h=1/(r-s);return e[0]=2*r*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*r*l,e[6]=0,e[7]=0,e[8]=(i+t)*o,e[9]=(n+a)*l,e[10]=(s+r)*h,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*r*2*h,e[15]=0,e},t.ortho=function(e,t,i,a,n,r,s){var o=1/(t-i),l=1/(a-n),h=1/(r-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+i)*o,e[13]=(n+a)*l,e[14]=(s+r)*h,e[15]=1,e};var a=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t.default=e,t}(i(0));function n(e,t,i){var a=t[0],n=t[1],r=t[2],s=t[3],o=t[4],l=t[5],h=t[6],c=t[7],d=t[8],m=t[9],f=t[10],u=t[11],p=t[12],g=t[13],v=t[14],x=t[15],w=i[0],M=i[1],b=i[2],T=i[3];return e[0]=w*a+M*o+b*d+T*p,e[1]=w*n+M*l+b*m+T*g,e[2]=w*r+M*h+b*f+T*v,e[3]=w*s+M*c+b*u+T*x,w=i[4],M=i[5],b=i[6],T=i[7],e[4]=w*a+M*o+b*d+T*p,e[5]=w*n+M*l+b*m+T*g,e[6]=w*r+M*h+b*f+T*v,e[7]=w*s+M*c+b*u+T*x,w=i[8],M=i[9],b=i[10],T=i[11],e[8]=w*a+M*o+b*d+T*p,e[9]=w*n+M*l+b*m+T*g,e[10]=w*r+M*h+b*f+T*v,e[11]=w*s+M*c+b*u+T*x,w=i[12],M=i[13],b=i[14],T=i[15],e[12]=w*a+M*o+b*d+T*p,e[13]=w*n+M*l+b*m+T*g,e[14]=w*r+M*h+b*f+T*v,e[15]=w*s+M*c+b*u+T*x,e}}])}));let Transform,canvasWidth,canvasHeight,imageURL,image,minBound,maxBound,orthographic,angleOfView,initialZoom,viewportMargin,zoomFactor,zoomPinchFactor,zoomPinchCap,zoomStep,shiftHoldDistance,shiftWaitTime,vibrateTime,canvasWidth0,canvasHeight0,zoom0,embedded,canvas,gl,alpha,offscreen,context,maxMaterials,halfCanvasWidth,halfCanvasHeight,P=[],Materials=[],Lights=[],Centers=[],Background=[1,1,1,1],absolute=!1,ibl=!1,viewportShift=[0,0],webgl2=!1,nlights=0,Nmaterials=2,materials=[];const pixelResolution=.75,zoomRemeshFactor=1.5,FillFactor=.1,windowTrim=10,third=1/3,pi=Math.acos(-1),radians=pi/180;let Zoom,lastZoom,xshift,yshift,maxViewportWidth,maxViewportHeight,H,zmin,zmax,size2,ArcballFactor,rotMat=mat4.create(),projMat=mat4.create(),viewMat=mat4.create(),projViewMat=mat4.create(),normMat=mat3.create(),viewMat3=mat3.create(),cjMatInv=mat4.create(),Temp=mat4.create(),center={x:0,y:0,z:0},shift={x:0,y:0},viewParam={xmin:0,xmax:0,ymin:0,ymax:0,zmin:0,zmax:0},remesh=!0,wireframe=0,mouseDownOrTouchActive=!1,lastMouseX=null,lastMouseY=null,touchID=null,Positions=[],Normals=[],Colors=[],Indices=[],IBLReflMap=null,IBLDiffuseMap=null,IBLbdrfMap=null;function IBLReady(){return null!==IBLReflMap&&null!==IBLDiffuseMap&&null!==IBLbdrfMap}function SetIBL(){embedded||deleteShaders(),initShaders(ibl)}let roughnessStepCount=8;class Material{constructor(e,t,i,a,n,r){this.diffuse=e,this.emissive=t,this.specular=i,this.shininess=a,this.metallic=n,this.fresnel0=r}setUniform(e,t){let i=i=>gl.getUniformLocation(e,"Materials["+t+"]."+i);gl.uniform4fv(i("diffuse"),new Float32Array(this.diffuse)),gl.uniform4fv(i("emissive"),new Float32Array(this.emissive)),gl.uniform4fv(i("specular"),new Float32Array(this.specular)),gl.uniform4f(i("parameters"),this.shininess,this.metallic,this.fresnel0,0)}}let indexExt,TRIANGLES,material0Data,material1Data,materialData,colorData,transparentData,triangleData,materialIndex,enumPointLight=1,enumDirectionalLight=2;class Light{constructor(e,t){this.direction=e,this.color=t}setUniform(e,t){let i=i=>gl.getUniformLocation(e,"Lights["+t+"]."+i);gl.uniform3fv(i("direction"),new Float32Array(this.direction)),gl.uniform3fv(i("color"),new Float32Array(this.color))}}function initShaders(e=!1){let t=gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);maxMaterials=Math.floor((t-14)/4),Nmaterials=Math.min(Math.max(Nmaterials,Materials.length),maxMaterials),pixelOpt=["WIDTH"],materialOpt=["NORMAL"],colorOpt=["NORMAL","COLOR"],transparentOpt=["NORMAL","COLOR","TRANSPARENT"],e&&(materialOpt.push("USE_IBL"),transparentOpt.push("USE_IBL")),pixelShader=initShader(pixelOpt),materialShader=initShader(materialOpt),colorShader=initShader(colorOpt),transparentShader=initShader(transparentOpt)}function deleteShaders(){gl.deleteProgram(transparentShader),gl.deleteProgram(colorShader),gl.deleteProgram(materialShader),gl.deleteProgram(pixelShader)}function saveAttributes(){let e=webgl2?window.top.document.asygl2[alpha]:window.top.document.asygl[alpha];e.gl=gl,e.nlights=Lights.length,e.Nmaterials=Nmaterials,e.maxMaterials=maxMaterials,e.pixelShader=pixelShader,e.materialShader=materialShader,e.colorShader=colorShader,e.transparentShader=transparentShader}function restoreAttributes(){let e=webgl2?window.top.document.asygl2[alpha]:window.top.document.asygl[alpha];gl=e.gl,nlights=e.nlights,Nmaterials=e.Nmaterials,maxMaterials=e.maxMaterials,pixelShader=e.pixelShader,materialShader=e.materialShader,colorShader=e.colorShader,transparentShader=e.transparentShader}function webGL(e,t){let i;return webgl2&&(i=e.getContext("webgl2",{alpha:t}),embedded&&!i)?(webgl2=!1,ibl=!1,initGL(!1),null):(i||(webgl2=!1,ibl=!1,i=e.getContext("webgl",{alpha:t})),i||alert("Could not initialize WebGL"),i)}function initGL(e=!0){if(ibl&&(webgl2=!0),alpha=Background[3]<1,embedded){let t=window.top.document;if(e&&(context=canvas.getContext("2d")),offscreen=webgl2?t.offscreen2:t.offscreen,offscreen||(offscreen=t.createElement("canvas"),webgl2?t.offscreen2=offscreen:t.offscreen=offscreen),webgl2?t.asygl2||(t.asygl2=Array(2)):t.asygl||(t.asygl=Array(2)),asygl=webgl2?t.asygl2:t.asygl,asygl[alpha]&&asygl[alpha].gl)restoreAttributes(),(Lights.length!=nlights||Math.min(Materials.length,maxMaterials)>Nmaterials)&&(initShaders(),saveAttributes());else{if(rc=webGL(offscreen,alpha),!rc)return;gl=rc,initShaders(),webgl2?t.asygl2[alpha]={}:t.asygl[alpha]={},saveAttributes()}}else gl=webGL(canvas,alpha),initShaders();indexExt=gl.getExtension("OES_element_index_uint"),TRIANGLES=gl.TRIANGLES,material0Data=new vertexBuffer(gl.POINTS),material1Data=new vertexBuffer(gl.LINES),materialData=new vertexBuffer,colorData=new vertexBuffer,transparentData=new vertexBuffer,triangleData=new vertexBuffer}function getShader(e,t,i,a=[]){let n=webgl2?"300 es":"100",r=Array(...a),s=[["nlights",0==wireframe?Lights.length:0],["Nmaterials",Nmaterials]],o=[["int","Nlights",Math.max(Lights.length,1)]];webgl2&&r.push("WEBGL2"),ibl&&s.push(["ROUGHNESS_STEP_COUNT",roughnessStepCount.toFixed(2)]),orthographic&&r.push("ORTHOGRAPHIC"),macros_str=s.map(e=>`#define ${e[0]} ${e[1]}`).join("\n"),define_str=r.map(e=>"#define "+e).join("\n"),const_str=o.map(e=>`const ${e[0]} ${e[1]}=${e[2]};`).join("\n"),ext_str=[].map(e=>`#extension ${e}: enable`).join("\n"),shaderSrc=`#version ${n}\n${ext_str}\n${define_str}\n${const_str}\n${macros_str}\n\n\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n \n${t}\n `;let l=e.createShader(i);return e.shaderSource(l,shaderSrc),e.compileShader(l),e.getShaderParameter(l,e.COMPILE_STATUS)?l:(alert(e.getShaderInfoLog(l)),null)}function registerBuffer(e,t,i,a=gl.ARRAY_BUFFER){return e.length>0&&(0==t&&(t=gl.createBuffer(),i=!0),gl.bindBuffer(a,t),i&&gl.bufferData(a,e,gl.STATIC_DRAW)),t}function drawBuffer(e,t,i=e.indices){if(0==e.indices.length)return;let a=t!=pixelShader;setUniforms(e,t),null!=IBLDiffuseMap&&(gl.activeTexture(gl.TEXTURE0),gl.bindTexture(gl.TEXTURE_2D,IBLbdrfMap),gl.uniform1i(gl.getUniformLocation(t,"reflBRDFSampler"),0),gl.activeTexture(gl.TEXTURE1),gl.bindTexture(gl.TEXTURE_2D,IBLDiffuseMap),gl.uniform1i(gl.getUniformLocation(t,"diffuseSampler"),1),gl.activeTexture(gl.TEXTURE2),gl.bindTexture(gl.TEXTURE_2D,IBLReflMap),gl.uniform1i(gl.getUniformLocation(t,"reflImgSampler"),2));let n=remesh||e.partial||!e.rendered;e.verticesBuffer=registerBuffer(new Float32Array(e.vertices),e.verticesBuffer,n),gl.vertexAttribPointer(positionAttribute,3,gl.FLOAT,!1,a?24:16,0),a?Lights.length>0&&gl.vertexAttribPointer(normalAttribute,3,gl.FLOAT,!1,24,12):gl.vertexAttribPointer(widthAttribute,1,gl.FLOAT,!1,16,12),e.materialsBuffer=registerBuffer(new Int16Array(e.materialIndices),e.materialsBuffer,n),gl.vertexAttribPointer(materialAttribute,1,gl.SHORT,!1,2,0),t!=colorShader&&t!=transparentShader||(e.colorsBuffer=registerBuffer(new Uint8Array(e.colors),e.colorsBuffer,n),gl.vertexAttribPointer(colorAttribute,4,gl.UNSIGNED_BYTE,!0,0,0)),e.indicesBuffer=registerBuffer(indexExt?new Uint32Array(i):new Uint16Array(i),e.indicesBuffer,n,gl.ELEMENT_ARRAY_BUFFER),e.rendered=!0,gl.drawElements(a?wireframe?gl.LINES:e.type:gl.POINTS,i.length,indexExt?gl.UNSIGNED_INT:gl.UNSIGNED_SHORT,0)}class vertexBuffer{constructor(e){this.type=e||TRIANGLES,this.verticesBuffer=0,this.materialsBuffer=0,this.colorsBuffer=0,this.indicesBuffer=0,this.rendered=!1,this.partial=!1,this.clear()}clear(){this.vertices=[],this.materialIndices=[],this.colors=[],this.indices=[],this.nvertices=0,this.materials=[],this.materialTable=[]}vertex(e,t){return this.vertices.push(e[0]),this.vertices.push(e[1]),this.vertices.push(e[2]),this.vertices.push(t[0]),this.vertices.push(t[1]),this.vertices.push(t[2]),this.materialIndices.push(materialIndex),this.nvertices++}Vertex(e,t,i=[0,0,0,0]){return this.vertices.push(e[0]),this.vertices.push(e[1]),this.vertices.push(e[2]),this.vertices.push(t[0]),this.vertices.push(t[1]),this.vertices.push(t[2]),this.materialIndices.push(materialIndex),this.colors.push(i[0]),this.colors.push(i[1]),this.colors.push(i[2]),this.colors.push(i[3]),this.nvertices++}vertex0(e,t){return this.vertices.push(e[0]),this.vertices.push(e[1]),this.vertices.push(e[2]),this.vertices.push(t),this.materialIndices.push(materialIndex),this.nvertices++}iVertex(e,t,i,a=[0,0,0,0]){let n=6*e;this.vertices[n]=t[0],this.vertices[n+1]=t[1],this.vertices[n+2]=t[2],this.vertices[n+3]=i[0],this.vertices[n+4]=i[1],this.vertices[n+5]=i[2],this.materialIndices[e]=materialIndex;let r=4*e;this.colors[r]=a[0],this.colors[r+1]=a[1],this.colors[r+2]=a[2],this.colors[r+3]=a[3],this.indices.push(e)}append(e){append(this.vertices,e.vertices),append(this.materialIndices,e.materialIndices),append(this.colors,e.colors),appendOffset(this.indices,e.indices,this.nvertices),this.nvertices+=e.nvertices}}function append(e,t){let i=e.length,a=t.length;e.length+=a;for(let n=0;n<a;++n)e[i+n]=t[n]}function appendOffset(e,t,i){let a=e.length,n=t.length;e.length+=t.length;for(let r=0;r<n;++r)e[a+r]=t[r]+i}class Geometry{constructor(){this.data=new vertexBuffer,this.Onscreen=!1,this.m=[]}offscreen(e){let t=projViewMat,i=e[0],a=i[0],n=i[1],r=i[2],s=1/(t[3]*a+t[7]*n+t[11]*r+t[15]);this.x=this.X=(t[0]*a+t[4]*n+t[8]*r+t[12])*s,this.y=this.Y=(t[1]*a+t[5]*n+t[9]*r+t[13])*s;for(let i=1,a=e.length;i<a;++i){let a=e[i],n=a[0],r=a[1],s=a[2],o=1/(t[3]*n+t[7]*r+t[11]*s+t[15]),l=(t[0]*n+t[4]*r+t[8]*s+t[12])*o,h=(t[1]*n+t[5]*r+t[9]*s+t[13])*o;l<this.x?this.x=l:l>this.X&&(this.X=l),h<this.y?this.y=h:h>this.Y&&(this.Y=h)}return(this.X<-1.01||this.x>1.01||this.Y<-1.01||this.y>1.01)&&(this.Onscreen=!1,!0)}T(e){let t=this.c[0],i=this.c[1],a=this.c[2],n=e[0]-t,r=e[1]-i,s=e[2]-a;return[n*normMat[0]+r*normMat[3]+s*normMat[6]+t,n*normMat[1]+r*normMat[4]+s*normMat[7]+i,n*normMat[2]+r*normMat[5]+s*normMat[8]+a]}Tcorners(e,t){return[this.T(e),this.T([e[0],e[1],t[2]]),this.T([e[0],t[1],e[2]]),this.T([e[0],t[1],t[2]]),this.T([t[0],e[1],e[2]]),this.T([t[0],e[1],t[2]]),this.T([t[0],t[1],e[2]]),this.T(t)]}setMaterial(e,t){null==e.materialTable[this.MaterialIndex]&&(e.materials.length>=Nmaterials&&(e.partial=!0,t()),e.materialTable[this.MaterialIndex]=e.materials.length,e.materials.push(Materials[this.MaterialIndex])),materialIndex=e.materialTable[this.MaterialIndex]}render(){let e;if(this.setMaterialIndex(),0==this.CenterIndex?e=corners(this.Min,this.Max):(this.c=Centers[this.CenterIndex-1],e=this.Tcorners(this.Min,this.Max)),this.offscreen(e))return this.data.clear(),void this.notRendered();let t,i=this.controlpoints;if(0==this.CenterIndex){if(!remesh&&this.Onscreen)return void this.append();t=i}else{let e=i.length;t=Array(e);for(let a=0;a<e;++a)t[a]=this.T(i[a])}let a=orthographic?1:this.Min[2]/maxBound[2],n=.75*Math.hypot(a*(viewParam.xmax-viewParam.xmin),a*(viewParam.ymax-viewParam.ymin))/size2;this.res2=n*n,this.Epsilon=.1*n,this.data.clear(),this.notRendered(),this.Onscreen=!0,this.process(t)}}class BezierPatch extends Geometry{constructor(e,t,i,a,n,r){super(),this.controlpoints=e,this.CenterIndex=t,this.MaterialIndex=i,this.Min=a,this.Max=n,this.color=r;let s=e.length;if(r){let e=r[0][3]+r[1][3]+r[2][3];this.transparent=16==s||4==s?e+r[3][3]<1020:e<765}else this.transparent=Materials[i].diffuse[3]<1;this.vertex=this.transparent?this.data.Vertex.bind(this.data):this.data.vertex.bind(this.data),this.L2norm(this.controlpoints)}setMaterialIndex(){this.transparent?this.setMaterial(transparentData,drawTransparent):this.color?this.setMaterial(colorData,drawColor):this.setMaterial(materialData,drawMaterial)}L2norm(e){let t=e[0];this.epsilon=0;let i=e.length;for(let a=1;a<i;++a)this.epsilon=Math.max(this.epsilon,abs2([e[a][0]-t[0],e[a][1]-t[1],e[a][2]-t[2]]));this.epsilon*=Number.EPSILON}processTriangle(e){let t=e[0],i=e[1],a=e[2],n=unit(cross([i[0]-t[0],i[1]-t[1],i[2]-t[2]],[a[0]-t[0],a[1]-t[1],a[2]-t[2]]));if(!this.offscreen([t,i,a])){let e,r,s;this.color?(e=this.data.Vertex(t,n,this.color[0]),r=this.data.Vertex(i,n,this.color[1]),s=this.data.Vertex(a,n,this.color[2])):(e=this.vertex(t,n),r=this.vertex(i,n),s=this.vertex(a,n)),0==wireframe?(this.data.indices.push(e),this.data.indices.push(r),this.data.indices.push(s)):(this.data.indices.push(e),this.data.indices.push(r),this.data.indices.push(r),this.data.indices.push(s),this.data.indices.push(s),this.data.indices.push(e)),this.append()}}processQuad(e){let t=e[0],i=e[1],a=e[2],n=e[3],r=cross([i[0]-t[0],i[1]-t[1],i[2]-t[2]],[a[0]-i[0],a[1]-i[1],a[2]-i[2]]),s=cross([a[0]-n[0],a[1]-n[1],a[2]-n[2]],[n[0]-t[0],n[1]-t[1],n[2]-t[2]]),o=unit([r[0]+s[0],r[1]+s[1],r[2]+s[2]]);if(!this.offscreen([t,i,a,n])){let e,r,s,l;this.color?(e=this.data.Vertex(t,o,this.color[0]),r=this.data.Vertex(i,o,this.color[1]),s=this.data.Vertex(a,o,this.color[2]),l=this.data.Vertex(n,o,this.color[3])):(e=this.vertex(t,o),r=this.vertex(i,o),s=this.vertex(a,o),l=this.vertex(n,o)),0==wireframe?(this.data.indices.push(e),this.data.indices.push(r),this.data.indices.push(s),this.data.indices.push(e),this.data.indices.push(s),this.data.indices.push(l)):(this.data.indices.push(e),this.data.indices.push(r),this.data.indices.push(r),this.data.indices.push(s),this.data.indices.push(s),this.data.indices.push(l),this.data.indices.push(l),this.data.indices.push(e)),this.append()}}curve(e,t,i,a,n){new BezierCurve([e[t],e[i],e[a],e[n]],0,materialIndex,this.Min,this.Max).render()}process(e){if(this.transparent&&1!=wireframe&&(materialIndex=this.color?-1-materialIndex:1+materialIndex),10==e.length)return this.process3(e);if(3==e.length)return this.processTriangle(e);if(4==e.length)return this.processQuad(e);if(1==wireframe)return this.curve(e,0,4,8,12),this.curve(e,12,13,14,15),this.curve(e,15,11,7,3),void this.curve(e,3,2,1,0);let t=e[0],i=e[3],a=e[12],n=e[15],r=this.normal(i,e[2],e[1],t,e[4],e[8],a);abs2(r)<this.epsilon&&(r=this.normal(i,e[2],e[1],t,e[13],e[14],n),abs2(r)<this.epsilon&&(r=this.normal(n,e[11],e[7],i,e[4],e[8],a)));let s=this.normal(t,e[4],e[8],a,e[13],e[14],n);abs2(s)<this.epsilon&&(s=this.normal(t,e[4],e[8],a,e[11],e[7],i),abs2(s)<this.epsilon&&(s=this.normal(i,e[2],e[1],t,e[13],e[14],n)));let o=this.normal(a,e[13],e[14],n,e[11],e[7],i);abs2(o)<this.epsilon&&(o=this.normal(a,e[13],e[14],n,e[2],e[1],t),abs2(o)<this.epsilon&&(o=this.normal(t,e[4],e[8],a,e[11],e[7],i)));let l=this.normal(n,e[11],e[7],i,e[2],e[1],t);if(abs2(l)<this.epsilon&&(l=this.normal(n,e[11],e[7],i,e[4],e[8],a),abs2(l)<this.epsilon&&(l=this.normal(a,e[13],e[14],n,e[2],e[1],t))),this.color){let h=this.color[0],c=this.color[1],d=this.color[2],m=this.color[3],f=this.data.Vertex(t,r,h),u=this.data.Vertex(a,s,c),p=this.data.Vertex(n,o,d),g=this.data.Vertex(i,l,m);this.Render(e,f,u,p,g,t,a,n,i,!1,!1,!1,!1,h,c,d,m)}else{let h=this.vertex(t,r),c=this.vertex(a,s),d=this.vertex(n,o),m=this.vertex(i,l);this.Render(e,h,c,d,m,t,a,n,i,!1,!1,!1,!1)}this.data.indices.length>0&&this.append()}append(){this.transparent?transparentData.append(this.data):this.color?colorData.append(this.data):materialData.append(this.data)}notRendered(){this.transparent?transparentData.rendered=!1:this.color?colorData.rendered=!1:materialData.rendered=!1}Render(e,t,i,a,n,r,s,o,l,h,c,d,m,f,u,p,g){let v=this.Distance(e);if(v[0]<this.res2&&v[1]<this.res2)this.offscreen([r,s,o])||(0==wireframe?(this.data.indices.push(t),this.data.indices.push(i),this.data.indices.push(a)):(this.data.indices.push(t),this.data.indices.push(i),this.data.indices.push(i),this.data.indices.push(a))),this.offscreen([r,o,l])||(0==wireframe?(this.data.indices.push(t),this.data.indices.push(a),this.data.indices.push(n)):(this.data.indices.push(a),this.data.indices.push(n),this.data.indices.push(n),this.data.indices.push(t)));else{if(this.offscreen(e))return;let x=e[0],w=e[3],M=e[12],b=e[15];if(v[0]<this.res2){let v=new Split3(x,e[1],e[2],w),T=new Split3(e[4],e[5],e[6],e[7]),S=new Split3(e[8],e[9],e[10],e[11]),R=new Split3(M,e[13],e[14],b),A=[x,v.m0,v.m3,v.m5,e[4],T.m0,T.m3,T.m5,e[8],S.m0,S.m3,S.m5,M,R.m0,R.m3,R.m5],I=[v.m5,v.m4,v.m2,w,T.m5,T.m4,T.m2,e[7],S.m5,S.m4,S.m2,e[11],R.m5,R.m4,R.m2,b],P=this.normal(A[12],A[13],A[14],A[15],A[11],A[7],A[3]);abs2(P)<=this.epsilon&&(P=this.normal(A[12],A[13],A[14],A[15],A[2],A[1],A[0]),abs2(P)<=this.epsilon&&(P=this.normal(A[0],A[4],A[8],A[12],A[11],A[7],A[3])));let E=this.normal(I[3],I[2],I[1],I[0],I[4],I[8],I[12]);abs2(E)<=this.epsilon&&(E=this.normal(I[3],I[2],I[1],I[0],I[13],I[14],I[15]),abs2(E)<=this.epsilon&&(E=this.normal(I[15],I[11],I[7],I[3],I[4],I[8],I[12])));let y=this.Epsilon,L=[.5*(s[0]+o[0]),.5*(s[1]+o[1]),.5*(s[2]+o[2])];if(!c)if(c=Straightness(M,e[13],e[14],b)<this.res2){let e=unit(this.differential(I[12],I[8],I[4],I[0]));L=[L[0]-y*e[0],L[1]-y*e[1],L[2]-y*e[2]]}else L=A[15];let D=[.5*(l[0]+r[0]),.5*(l[1]+r[1]),.5*(l[2]+r[2])];if(!m)if(m=Straightness(x,e[1],e[2],w)<this.res2){let e=unit(this.differential(A[3],A[7],A[11],A[15]));D=[D[0]-y*e[0],D[1]-y*e[1],D[2]-y*e[2]]}else D=I[0];if(f){let e=Array(4),v=Array(4);for(let t=0;t<4;++t)e[t]=.5*(u[t]+p[t]),v[t]=.5*(g[t]+f[t]);let x=this.data.Vertex(L,P,e),w=this.data.Vertex(D,E,v);this.Render(A,t,i,x,w,r,s,L,D,h,c,!1,m,f,u,e,v),this.Render(I,w,x,a,n,D,L,o,l,!1,c,d,m,v,e,p,g)}else{let e=this.vertex(L,P),f=this.vertex(D,E);this.Render(A,t,i,e,f,r,s,L,D,h,c,!1,m),this.Render(I,f,e,a,n,D,L,o,l,!1,c,d,m)}return}if(v[1]<this.res2){let v=new Split3(x,e[4],e[8],M),T=new Split3(e[1],e[5],e[9],e[13]),S=new Split3(e[2],e[6],e[10],e[14]),R=new Split3(w,e[7],e[11],b),A=[x,e[1],e[2],w,v.m0,T.m0,S.m0,R.m0,v.m3,T.m3,S.m3,R.m3,v.m5,T.m5,S.m5,R.m5],I=[v.m5,T.m5,S.m5,R.m5,v.m4,T.m4,S.m4,R.m4,v.m2,T.m2,S.m2,R.m2,M,e[13],e[14],b],P=this.normal(A[0],A[4],A[8],A[12],A[13],A[14],A[15]);abs2(P)<=this.epsilon&&(P=this.normal(A[0],A[4],A[8],A[12],A[11],A[7],A[3]),abs2(P)<=this.epsilon&&(P=this.normal(A[3],A[2],A[1],A[0],A[13],A[14],A[15])));let E=this.normal(I[15],I[11],I[7],I[3],I[2],I[1],I[0]);abs2(E)<=this.epsilon&&(E=this.normal(I[15],I[11],I[7],I[3],I[4],I[8],I[12]),abs2(E)<=this.epsilon&&(E=this.normal(I[12],I[13],I[14],I[15],I[2],I[1],I[0])));let y=this.Epsilon,L=[.5*(r[0]+s[0]),.5*(r[1]+s[1]),.5*(r[2]+s[2])];if(!h)if(h=Straightness(x,e[4],e[8],M)<this.res2){let e=unit(this.differential(I[0],I[1],I[2],I[3]));L=[L[0]-y*e[0],L[1]-y*e[1],L[2]-y*e[2]]}else L=A[12];let D=[.5*(o[0]+l[0]),.5*(o[1]+l[1]),.5*(o[2]+l[2])];if(!d)if(d=Straightness(b,e[11],e[7],w)<this.res2){let e=unit(this.differential(A[15],A[14],A[13],A[12]));D=[D[0]-y*e[0],D[1]-y*e[1],D[2]-y*e[2]]}else D=I[3];if(f){let e=Array(4),v=Array(4);for(let t=0;t<4;++t)e[t]=.5*(f[t]+u[t]),v[t]=.5*(p[t]+g[t]);let x=this.data.Vertex(L,P,e),w=this.data.Vertex(D,E,v);this.Render(A,t,x,w,n,r,L,D,l,h,!1,d,m,f,e,v,g),this.Render(I,x,i,a,w,L,s,o,D,h,c,d,!1,e,u,p,v)}else{let e=this.vertex(L,P),f=this.vertex(D,E);this.Render(A,t,e,f,n,r,L,D,l,h,!1,d,m),this.Render(I,e,i,a,f,L,s,o,D,h,c,d,!1)}return}let T=new Split3(x,e[1],e[2],w),S=new Split3(e[4],e[5],e[6],e[7]),R=new Split3(e[8],e[9],e[10],e[11]),A=new Split3(M,e[13],e[14],b),I=new Split3(x,e[4],e[8],M),P=new Split3(T.m0,S.m0,R.m0,A.m0),E=new Split3(T.m3,S.m3,R.m3,A.m3),y=new Split3(T.m5,S.m5,R.m5,A.m5),L=new Split3(T.m4,S.m4,R.m4,A.m4),D=new Split3(T.m2,S.m2,R.m2,A.m2),O=new Split3(w,e[7],e[11],b),B=[x,T.m0,T.m3,T.m5,I.m0,P.m0,E.m0,y.m0,I.m3,P.m3,E.m3,y.m3,I.m5,P.m5,E.m5,y.m5],N=[I.m5,P.m5,E.m5,y.m5,I.m4,P.m4,E.m4,y.m4,I.m2,P.m2,E.m2,y.m2,M,A.m0,A.m3,A.m5],z=[y.m5,L.m5,D.m5,O.m5,y.m4,L.m4,D.m4,O.m4,y.m2,L.m2,D.m2,O.m2,A.m5,A.m4,A.m2,b],_=[T.m5,T.m4,T.m2,w,y.m0,L.m0,D.m0,O.m0,y.m3,L.m3,D.m3,O.m3,y.m5,L.m5,D.m5,O.m5],C=B[15],V=this.normal(B[0],B[4],B[8],B[12],B[13],B[14],B[15]);abs2(V)<this.epsilon&&(V=this.normal(B[0],B[4],B[8],B[12],B[11],B[7],B[3]),abs2(V)<this.epsilon&&(V=this.normal(B[3],B[2],B[1],B[0],B[13],B[14],B[15])));let U=this.normal(N[12],N[13],N[14],N[15],N[11],N[7],N[3]);abs2(U)<this.epsilon&&(U=this.normal(N[12],N[13],N[14],N[15],N[2],N[1],N[0]),abs2(U)<this.epsilon&&(U=this.normal(N[0],N[4],N[8],N[12],N[11],N[7],N[3])));let H=this.normal(z[15],z[11],z[7],z[3],z[2],z[1],z[0]);abs2(H)<this.epsilon&&(H=this.normal(z[15],z[11],z[7],z[3],z[4],z[8],z[12]),abs2(H)<this.epsilon&&(H=this.normal(z[12],z[13],z[14],z[15],z[2],z[1],z[0])));let G=this.normal(_[3],_[2],_[1],_[0],_[4],_[8],_[12]);abs2(G)<this.epsilon&&(G=this.normal(_[3],_[2],_[1],_[0],_[13],_[14],_[15]),abs2(G)<this.epsilon&&(G=this.normal(_[15],_[11],_[7],_[3],_[4],_[8],_[12])));let F=this.normal(z[3],z[2],z[1],C,z[4],z[8],z[12]),W=this.Epsilon,X=[.5*(r[0]+s[0]),.5*(r[1]+s[1]),.5*(r[2]+s[2])];if(!h)if(h=Straightness(x,e[4],e[8],M)<this.res2){let e=unit(this.differential(N[0],N[1],N[2],N[3]));X=[X[0]-W*e[0],X[1]-W*e[1],X[2]-W*e[2]]}else X=B[12];let j=[.5*(s[0]+o[0]),.5*(s[1]+o[1]),.5*(s[2]+o[2])];if(!c)if(c=Straightness(M,e[13],e[14],b)<this.res2){let e=unit(this.differential(z[12],z[8],z[4],z[0]));j=[j[0]-W*e[0],j[1]-W*e[1],j[2]-W*e[2]]}else j=N[15];let Z=[.5*(o[0]+l[0]),.5*(o[1]+l[1]),.5*(o[2]+l[2])];if(!d)if(d=Straightness(b,e[11],e[7],w)<this.res2){let e=unit(this.differential(_[15],_[14],_[13],_[12]));Z=[Z[0]-W*e[0],Z[1]-W*e[1],Z[2]-W*e[2]]}else Z=z[3];let k=[.5*(l[0]+r[0]),.5*(l[1]+r[1]),.5*(l[2]+r[2])];if(!m)if(m=Straightness(x,e[1],e[2],w)<this.res2){let e=unit(this.differential(B[3],B[7],B[11],B[15]));k=[k[0]-W*e[0],k[1]-W*e[1],k[2]-W*e[2]]}else k=_[0];if(f){let e=Array(4),v=Array(4),x=Array(4),w=Array(4),M=Array(4);for(let t=0;t<4;++t)e[t]=.5*(f[t]+u[t]),v[t]=.5*(u[t]+p[t]),x[t]=.5*(p[t]+g[t]),w[t]=.5*(g[t]+f[t]),M[t]=.5*(e[t]+x[t]);let b=this.data.Vertex(X,V,e),T=this.data.Vertex(j,U,v),S=this.data.Vertex(Z,H,x),R=this.data.Vertex(k,G,w),A=this.data.Vertex(C,F,M);this.Render(B,t,b,A,R,r,X,C,k,h,!1,!1,m,f,e,M,w),this.Render(N,b,i,T,A,X,s,j,C,h,c,!1,!1,e,u,v,M),this.Render(z,A,T,a,S,C,j,o,Z,!1,c,d,!1,M,v,p,x),this.Render(_,R,A,S,n,k,C,Z,l,!1,!1,d,m,w,M,x,g)}else{let e=this.vertex(X,V),f=this.vertex(j,U),u=this.vertex(Z,H),p=this.vertex(k,G),g=this.vertex(C,F);this.Render(B,t,e,g,p,r,X,C,k,h,!1,!1,m),this.Render(N,e,i,f,g,X,s,j,C,h,c,!1,!1),this.Render(z,g,f,a,u,C,j,o,Z,!1,c,d,!1),this.Render(_,p,g,u,n,k,C,Z,l,!1,!1,d,m)}}}process3(e){if(1==wireframe)return this.curve(e,0,1,3,6),this.curve(e,6,7,8,9),void this.curve(e,9,5,2,0);let t=e[0],i=e[6],a=e[9],n=this.normal(a,e[5],e[2],t,e[1],e[3],i),r=this.normal(t,e[1],e[3],i,e[7],e[8],a),s=this.normal(i,e[7],e[8],a,e[5],e[2],t);if(this.color){let o=this.color[0],l=this.color[1],h=this.color[2],c=this.data.Vertex(t,n,o),d=this.data.Vertex(i,r,l),m=this.data.Vertex(a,s,h);this.Render3(e,c,d,m,t,i,a,!1,!1,!1,o,l,h)}else{let o=this.vertex(t,n),l=this.vertex(i,r),h=this.vertex(a,s);this.Render3(e,o,l,h,t,i,a,!1,!1,!1)}this.data.indices.length>0&&this.append()}Render3(e,t,i,a,n,r,s,o,l,h,c,d,m){if(this.Distance3(e)<this.res2)this.offscreen([n,r,s])||(0==wireframe?(this.data.indices.push(t),this.data.indices.push(i),this.data.indices.push(a)):(this.data.indices.push(t),this.data.indices.push(i),this.data.indices.push(i),this.data.indices.push(a),this.data.indices.push(a),this.data.indices.push(t)));else{if(this.offscreen(e))return;let f=e[0],u=e[1],p=e[2],g=e[3],v=e[4],x=e[5],w=e[6],M=e[7],b=e[8],T=e[9],S=[.5*(T[0]+x[0]),.5*(T[1]+x[1]),.5*(T[2]+x[2])],R=[.5*(T[0]+b[0]),.5*(T[1]+b[1]),.5*(T[2]+b[2])],A=[.5*(x[0]+p[0]),.5*(x[1]+p[1]),.5*(x[2]+p[2])],I=[.5*(b[0]+v[0]),.5*(b[1]+v[1]),.5*(b[2]+v[2])],P=[.5*(b[0]+M[0]),.5*(b[1]+M[1]),.5*(b[2]+M[2])],E=[.5*(p[0]+v[0]),.5*(p[1]+v[1]),.5*(p[2]+v[2])],y=[.5*(p[0]+f[0]),.5*(p[1]+f[1]),.5*(p[2]+f[2])],L=[.5*(v[0]+g[0]),.5*(v[1]+g[1]),.5*(v[2]+g[2])],D=[.5*(M[0]+w[0]),.5*(M[1]+w[1]),.5*(M[2]+w[2])],O=[.5*(f[0]+u[0]),.5*(f[1]+u[1]),.5*(f[2]+u[2])],B=[.5*(u[0]+g[0]),.5*(u[1]+g[1]),.5*(u[2]+g[2])],N=[.5*(g[0]+w[0]),.5*(g[1]+w[1]),.5*(g[2]+w[2])],z=[.5*(S[0]+A[0]),.5*(S[1]+A[1]),.5*(S[2]+A[2])],_=[.5*(R[0]+P[0]),.5*(R[1]+P[1]),.5*(R[2]+P[2])],C=[.5*(A[0]+y[0]),.5*(A[1]+y[1]),.5*(A[2]+y[2])],V=[.5*I[0]+.25*(v[0]+u[0]),.5*I[1]+.25*(v[1]+u[1]),.5*I[2]+.25*(v[2]+u[2])],U=[.5*(P[0]+D[0]),.5*(P[1]+D[1]),.5*(P[2]+D[2])],H=[.5*E[0]+.25*(v[0]+M[0]),.5*E[1]+.25*(v[1]+M[1]),.5*E[2]+.25*(v[2]+M[2])],G=[.25*(x[0]+v[0])+.5*L[0],.25*(x[1]+v[1])+.5*L[1],.25*(x[2]+v[2])+.5*L[2]],F=[.5*(O[0]+B[0]),.5*(O[1]+B[1]),.5*(O[2]+B[2])],W=[.5*(B[0]+N[0]),.5*(B[1]+N[1]),.5*(B[2]+N[2])],X=[.5*(H[0]+F[0]),.5*(H[1]+F[1]),.5*(H[2]+F[2])],j=[.5*(H[0]+W[0]),.5*(H[1]+W[1]),.5*(H[2]+W[2])],Z=[.5*(F[0]+W[0]),.5*(F[1]+W[1]),.5*(F[2]+W[2])],k=[.5*(G[0]+U[0]),.5*(G[1]+U[1]),.5*(G[2]+U[2])],Y=[.5*(_[0]+G[0]),.5*(_[1]+G[1]),.5*(_[2]+G[2])],q=[.5*(_[0]+U[0]),.5*(_[1]+U[1]),.5*(_[2]+U[2])],$=[.5*(z[0]+V[0]),.5*(z[1]+V[1]),.5*(z[2]+V[2])],K=[.5*(C[0]+V[0]),.5*(C[1]+V[1]),.5*(C[2]+V[2])],Q=[.5*(z[0]+C[0]),.5*(z[1]+C[1]),.5*(z[2]+C[2])],J=[f,O,y,F,[.5*(E[0]+O[0]),.5*(E[1]+O[1]),.5*(E[2]+O[2])],C,Z,X,K,Q],ee=[Z,W,j,N,[.5*(L[0]+D[0]),.5*(L[1]+D[1]),.5*(L[2]+D[2])],k,w,D,U,q],te=[Q,$,z,Y,[.5*(S[0]+I[0]),.5*(S[1]+I[1]),.5*(S[2]+I[2])],S,q,_,R,T],ie=[q,Y,k,$,[.25*(A[0]+P[0]+B[0]+v[0]),.25*(A[1]+P[1]+B[1]+v[1]),.25*(A[2]+P[2]+B[2]+v[2])],j,Q,K,X,Z],ae=this.normal(Z,j,k,q,Y,$,Q),ne=this.normal(q,Y,$,Q,K,X,Z),re=this.normal(Q,K,X,Z,j,k,q),se=this.Epsilon,oe=[.5*(r[0]+s[0]),.5*(r[1]+s[1]),.5*(r[2]+s[2])];if(!o)if(o=Straightness(w,M,b,T)<this.res2){let e=unit(this.sumdifferential(ie[0],ie[2],ie[5],ie[9],ie[1],ie[3],ie[6]));oe=[oe[0]-se*e[0],oe[1]-se*e[1],oe[2]-se*e[2]]}else oe=q;let le=[.5*(s[0]+n[0]),.5*(s[1]+n[1]),.5*(s[2]+n[2])];if(!l)if(l=Straightness(f,p,x,T)<this.res2){let e=unit(this.sumdifferential(ie[6],ie[3],ie[1],ie[0],ie[7],ie[8],ie[9]));le=[le[0]-se*e[0],le[1]-se*e[1],le[2]-se*e[2]]}else le=Q;let he=[.5*(n[0]+r[0]),.5*(n[1]+r[1]),.5*(n[2]+r[2])];if(!h)if(h=Straightness(f,u,g,w)<this.res2){let e=unit(this.sumdifferential(ie[9],ie[8],ie[7],ie[6],ie[5],ie[2],ie[0]));he=[he[0]-se*e[0],he[1]-se*e[1],he[2]-se*e[2]]}else he=Z;if(c){let e=Array(4),f=Array(4),u=Array(4);for(let t=0;t<4;++t)e[t]=.5*(d[t]+m[t]),f[t]=.5*(m[t]+c[t]),u[t]=.5*(c[t]+d[t]);let p=this.data.Vertex(oe,ae,e),g=this.data.Vertex(le,ne,f),v=this.data.Vertex(he,re,u);this.Render3(J,t,v,g,n,he,le,!1,l,h,c,u,f),this.Render3(ee,v,i,p,he,r,oe,o,!1,h,u,d,e),this.Render3(te,g,p,a,le,oe,s,o,l,!1,f,e,m),this.Render3(ie,p,g,v,oe,le,he,!1,!1,!1,e,f,u)}else{let e=this.vertex(oe,ae),c=this.vertex(le,ne),d=this.vertex(he,re);this.Render3(J,t,d,c,n,he,le,!1,l,h),this.Render3(ee,d,i,e,he,r,oe,o,!1,h),this.Render3(te,c,e,a,le,oe,s,o,l,!1),this.Render3(ie,e,c,d,oe,le,he,!1,!1,!1)}}}Distance(e){let t=e[0],i=e[3],a=e[12],n=e[15],r=Flatness(t,a,i,n);r=Math.max(Straightness(t,e[4],e[8],a)),r=Math.max(r,Straightness(e[1],e[5],e[9],e[13])),r=Math.max(r,Straightness(i,e[7],e[11],n)),r=Math.max(r,Straightness(e[2],e[6],e[10],e[14]));let s=Flatness(t,i,a,n);return s=Math.max(s,Straightness(t,e[1],e[2],i)),s=Math.max(s,Straightness(e[4],e[5],e[6],e[7])),s=Math.max(s,Straightness(e[8],e[9],e[10],e[11])),s=Math.max(s,Straightness(a,e[13],e[14],n)),[r,s]}Distance3(e){let t=e[0],i=e[4],a=e[6],n=e[9],r=abs2([(t[0]+a[0]+n[0])*(1/3)-i[0],(t[1]+a[1]+n[1])*(1/3)-i[1],(t[2]+a[2]+n[2])*(1/3)-i[2]]);return r=Math.max(r,Straightness(t,e[1],e[3],a)),r=Math.max(r,Straightness(t,e[2],e[5],n)),Math.max(r,Straightness(a,e[7],e[8],n))}differential(e,t,i,a){let n=[3*(t[0]-e[0]),3*(t[1]-e[1]),3*(t[2]-e[2])];return abs2(n)>this.epsilon?n:(n=bezierPP(e,t,i),abs2(n)>this.epsilon?n:bezierPPP(e,t,i,a))}sumdifferential(e,t,i,a,n,r,s){let o=this.differential(e,t,i,a),l=this.differential(e,n,r,s);return[o[0]+l[0],o[1]+l[1],o[2]+l[2]]}normal(e,t,i,a,n,r,s){let o=3*(n[0]-a[0]),l=3*(n[1]-a[1]),h=3*(n[2]-a[2]),c=3*(i[0]-a[0]),d=3*(i[1]-a[1]),m=3*(i[2]-a[2]),f=[l*m-h*d,h*c-o*m,o*d-l*c];if(abs2(f)>this.epsilon)return f;let u=[c,d,m],p=[o,l,h],g=bezierPP(a,i,t),v=bezierPP(a,n,r),x=cross(v,u),w=cross(p,g);if(f=[x[0]+w[0],x[1]+w[1],x[2]+w[2]],abs2(f)>this.epsilon)return f;let M=bezierPPP(a,i,t,e),b=bezierPPP(a,n,r,s);x=cross(p,M),w=cross(b,u);let T=cross(v,g);return f=[x[0]+w[0]+T[0],x[1]+w[1]+T[1],x[2]+w[2]+T[2]],abs2(f)>this.epsilon?f:(x=cross(b,g),w=cross(v,M),f=[x[0]+w[0],x[1]+w[1],x[2]+w[2]],abs2(f)>this.epsilon?f:cross(b,M))}}class BezierCurve extends Geometry{constructor(e,t,i,a,n){super(),this.controlpoints=e,this.CenterIndex=t,this.MaterialIndex=i,this.Min=a,this.Max=n}setMaterialIndex(){this.setMaterial(material1Data,drawMaterial1)}processLine(e){let t=e[0],i=e[1];if(!this.offscreen([t,i])){let e=[0,0,1];this.data.indices.push(this.data.vertex(t,e)),this.data.indices.push(this.data.vertex(i,e)),this.append()}}process(e){if(2==e.length)return this.processLine(e);let t=e[0],i=e[1],a=e[2],n=e[3],r=this.normal(bezierP(t,i),bezierPP(t,i,a)),s=this.normal(bezierP(a,n),bezierPP(n,a,i)),o=this.data.vertex(t,r),l=this.data.vertex(n,s);this.Render(e,o,l),this.data.indices.length>0&&this.append()}append(){material1Data.append(this.data)}notRendered(){material1Data.rendered=!1}Render(e,t,i){let a=e[0],n=e[1],r=e[2],s=e[3];if(Straightness(a,n,r,s)<this.res2)this.offscreen([a,s])||(this.data.indices.push(t),this.data.indices.push(i));else{if(this.offscreen(e))return;let o=[.5*(a[0]+n[0]),.5*(a[1]+n[1]),.5*(a[2]+n[2])],l=[.5*(n[0]+r[0]),.5*(n[1]+r[1]),.5*(n[2]+r[2])],h=[.5*(r[0]+s[0]),.5*(r[1]+s[1]),.5*(r[2]+s[2])],c=[.5*(o[0]+l[0]),.5*(o[1]+l[1]),.5*(o[2]+l[2])],d=[.5*(l[0]+h[0]),.5*(l[1]+h[1]),.5*(l[2]+h[2])],m=[.5*(c[0]+d[0]),.5*(c[1]+d[1]),.5*(c[2]+d[2])],f=[a,o,c,m],u=[m,d,h,s],p=this.normal(bezierPh(a,n,r,s),bezierPPh(a,n,r,s)),g=this.data.vertex(m,p);this.Render(f,t,g),this.Render(u,g,i)}}normal(e,t){let i=dot(e,e),a=dot(e,t);return[i*t[0]-a*e[0],i*t[1]-a*e[1],i*t[2]-a*e[2]]}}class Pixel extends Geometry{constructor(e,t,i,a,n){super(),this.controlpoint=e,this.width=t,this.CenterIndex=0,this.MaterialIndex=i,this.Min=a,this.Max=n}setMaterialIndex(){this.setMaterial(material0Data,drawMaterial0)}process(e){this.data.indices.push(this.data.vertex0(this.controlpoint,this.width)),this.append()}append(){material0Data.append(this.data)}notRendered(){material0Data.rendered=!1}}class Triangles extends Geometry{constructor(e,t,i,a){super(),this.CenterIndex=e,this.MaterialIndex=t,this.Min=i,this.Max=a,this.controlpoints=Positions,this.Normals=Normals,this.Colors=Colors,this.Indices=Indices,Positions=[],Normals=[],Colors=[],Indices=[],this.transparent=Materials[this.MaterialIndex].diffuse[3]<1}setMaterialIndex(){this.transparent?this.setMaterial(transparentData,drawTransparent):this.setMaterial(triangleData,drawTriangle)}process(e){this.data.vertices=new Array(6*e.length),materialIndex=this.Colors.length>0?-1-materialIndex:1+materialIndex;for(let t=0,i=this.Indices.length;t<i;++t){let i=this.Indices[t],a=i[0],n=e[a[0]],r=e[a[1]],s=e[a[2]];if(!this.offscreen([n,r,s])){let e=i.length>1?i[1]:a;if(e&&0!=e.length||(e=a),this.Colors.length>0){let t=i.length>2?i[2]:a;t&&0!=t.length||(t=a);let o=this.Colors[t[0]],l=this.Colors[t[1]],h=this.Colors[t[2]];this.transparent|=o[3]+l[3]+h[3]<765,0==wireframe?(this.data.iVertex(a[0],n,this.Normals[e[0]],o),this.data.iVertex(a[1],r,this.Normals[e[1]],l),this.data.iVertex(a[2],s,this.Normals[e[2]],h)):(this.data.iVertex(a[0],n,this.Normals[e[0]],o),this.data.iVertex(a[1],r,this.Normals[e[1]],l),this.data.iVertex(a[1],r,this.Normals[e[1]],l),this.data.iVertex(a[2],s,this.Normals[e[2]],h),this.data.iVertex(a[2],s,this.Normals[e[2]],h),this.data.iVertex(a[0],n,this.Normals[e[0]],o))}else 0==wireframe?(this.data.iVertex(a[0],n,this.Normals[e[0]]),this.data.iVertex(a[1],r,this.Normals[e[1]]),this.data.iVertex(a[2],s,this.Normals[e[2]])):(this.data.iVertex(a[0],n,this.Normals[e[0]]),this.data.iVertex(a[1],r,this.Normals[e[1]]),this.data.iVertex(a[1],r,this.Normals[e[1]]),this.data.iVertex(a[2],s,this.Normals[e[2]]),this.data.iVertex(a[2],s,this.Normals[e[2]]),this.data.iVertex(a[0],n,this.Normals[e[0]]))}}this.data.nvertices=e.length,this.data.indices.length>0&&this.append()}append(){this.transparent?transparentData.append(this.data):triangleData.append(this.data)}notRendered(){this.transparent?transparentData.rendered=!1:triangleData.rendered=!1}}function redrawScene(){initProjection(),setProjection(),remesh=!0,drawScene()}function home(){mat4.identity(rotMat),redrawScene(),window.top.asyWebApplication&&window.top.asyWebApplication.setProjection(""),window.parent.asyProjection=!1}let positionAttribute=0,normalAttribute=1,materialAttribute=2,colorAttribute=3,widthAttribute=4;function initShader(e=[]){let t=getShader(gl,vertex,gl.VERTEX_SHADER,e),i=getShader(gl,fragment,gl.FRAGMENT_SHADER,e),a=gl.createProgram();return gl.attachShader(a,t),gl.attachShader(a,i),gl.bindAttribLocation(a,positionAttribute,"position"),gl.bindAttribLocation(a,normalAttribute,"normal"),gl.bindAttribLocation(a,materialAttribute,"materialIndex"),gl.bindAttribLocation(a,colorAttribute,"color"),gl.bindAttribLocation(a,widthAttribute,"width"),gl.linkProgram(a),gl.getProgramParameter(a,gl.LINK_STATUS)||alert("Could not initialize shaders"),a}class Split3{constructor(e,t,i,a){this.m0=[.5*(e[0]+t[0]),.5*(e[1]+t[1]),.5*(e[2]+t[2])];let n=.5*(t[0]+i[0]),r=.5*(t[1]+i[1]),s=.5*(t[2]+i[2]);this.m2=[.5*(i[0]+a[0]),.5*(i[1]+a[1]),.5*(i[2]+a[2])],this.m3=[.5*(this.m0[0]+n),.5*(this.m0[1]+r),.5*(this.m0[2]+s)],this.m4=[.5*(n+this.m2[0]),.5*(r+this.m2[1]),.5*(s+this.m2[2])],this.m5=[.5*(this.m3[0]+this.m4[0]),.5*(this.m3[1]+this.m4[1]),.5*(this.m3[2]+this.m4[2])]}}function unit(e){let t=1/(Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])||1);return[e[0]*t,e[1]*t,e[2]*t]}function abs2(e){return e[0]*e[0]+e[1]*e[1]+e[2]*e[2]}function dot(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function cross(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function bezierP(e,t){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function bezierPP(e,t,i){return[3*(e[0]+i[0])-6*t[0],3*(e[1]+i[1])-6*t[1],3*(e[2]+i[2])-6*t[2]]}function bezierPPP(e,t,i,a){return[a[0]-e[0]+3*(t[0]-i[0]),a[1]-e[1]+3*(t[1]-i[1]),a[2]-e[2]+3*(t[2]-i[2])]}function bezierPh(e,t,i,a){return[i[0]+a[0]-e[0]-t[0],i[1]+a[1]-e[1]-t[1],i[2]+a[2]-e[2]-t[2]]}function bezierPPh(e,t,i,a){return[3*e[0]-5*t[0]+i[0]+a[0],3*e[1]-5*t[1]+i[1]+a[1],3*e[2]-5*t[2]+i[2]+a[2]]}function Straightness(e,t,i,a){let n=[1/3*(a[0]-e[0]),1/3*(a[1]-e[1]),1/3*(a[2]-e[2])];return Math.max(abs2([t[0]-n[0]-e[0],t[1]-n[1]-e[1],t[2]-n[2]-e[2]]),abs2([a[0]-n[0]-i[0],a[1]-n[1]-i[1],a[2]-n[2]-i[2]]))}function Flatness(e,t,i,a){let n=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[a[0]-i[0],a[1]-i[1],a[2]-i[2]];return Math.max(abs2(cross(n,unit(r))),abs2(cross(r,unit(n))))/9}function corners(e,t){return[e,[e[0],e[1],t[2]],[e[0],t[1],e[2]],[e[0],t[1],t[2]],[t[0],e[1],e[2]],[t[0],e[1],t[2]],[t[0],t[1],e[2]],t]}function minbound(e){return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0],e[4][0],e[5][0],e[6][0],e[7][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1],e[4][1],e[5][1],e[6][1],e[7][1]),Math.min(e[0][2],e[1][2],e[2][2],e[3][2],e[4][2],e[5][2],e[6][2],e[7][2])]}function maxbound(e){return[Math.max(e[0][0],e[1][0],e[2][0],e[3][0],e[4][0],e[5][0],e[6][0],e[7][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1],e[4][1],e[5][1],e[6][1],e[7][1]),Math.max(e[0][2],e[1][2],e[2][2],e[3][2],e[4][2],e[5][2],e[6][2],e[7][2])]}function COBTarget(e,t){mat4.fromTranslation(Temp,[center.x,center.y,center.z]),mat4.invert(cjMatInv,Temp),mat4.multiply(e,t,cjMatInv),mat4.multiply(e,Temp,e)}function setUniforms(e,t){let i=t==pixelShader;gl.useProgram(t),gl.enableVertexAttribArray(positionAttribute),i&&gl.enableVertexAttribArray(widthAttribute);let a=!i&&Lights.length>0;if(a&&gl.enableVertexAttribArray(normalAttribute),gl.enableVertexAttribArray(materialAttribute),t.projViewMatUniform=gl.getUniformLocation(t,"projViewMat"),t.viewMatUniform=gl.getUniformLocation(t,"viewMat"),t.normMatUniform=gl.getUniformLocation(t,"normMat"),t!=colorShader&&t!=transparentShader||gl.enableVertexAttribArray(colorAttribute),a)for(let e=0;e<Lights.length;++e)Lights[e].setUniform(t,e);for(let i=0;i<e.materials.length;++i)e.materials[i].setUniform(t,i);gl.uniformMatrix4fv(t.projViewMatUniform,!1,projViewMat),gl.uniformMatrix4fv(t.viewMatUniform,!1,viewMat),gl.uniformMatrix3fv(t.normMatUniform,!1,normMat)}function handleMouseDown(e){zoomEnabled||enableZoom(),mouseDownOrTouchActive=!0,lastMouseX=e.clientX,lastMouseY=e.clientY}let pinchStart,touchStartTime,pinch=!1;function pinchDistance(e){return Math.hypot(e[0].pageX-e[1].pageX,e[0].pageY-e[1].pageY)}function handleTouchStart(e){e.preventDefault(),zoomEnabled||enableZoom();let t=e.targetTouches;swipe=rotate=pinch=!1,zooming||(1!=t.length||mouseDownOrTouchActive||(touchStartTime=(new Date).getTime(),touchId=t[0].identifier,lastMouseX=t[0].pageX,lastMouseY=t[0].pageY),2!=t.length||mouseDownOrTouchActive||(touchId=t[0].identifier,pinchStart=pinchDistance(t),pinch=!0))}function handleMouseUpOrTouchEnd(e){mouseDownOrTouchActive=!1}function rotateScene(e,t,i,a,n){if(e==i&&t==a)return;let[r,s]=arcball([e,-t],[i,-a]);mat4.fromRotation(Temp,2*n*ArcballFactor*r/Zoom,s),mat4.multiply(rotMat,Temp,rotMat)}function shiftScene(e,t,i,a){let n=1/Zoom;shift.x+=(i-e)*n*halfCanvasWidth,shift.y-=(a-t)*n*halfCanvasHeight}function panScene(e,t,i,a){orthographic?shiftScene(e,t,i,a):(center.x+=(i-e)*(viewParam.xmax-viewParam.xmin),center.y-=(a-t)*(viewParam.ymax-viewParam.ymin))}function updateViewMatrix(){COBTarget(viewMat,rotMat),mat4.translate(viewMat,viewMat,[center.x,center.y,0]),mat3.fromMat4(viewMat3,viewMat),mat3.invert(normMat,viewMat3),mat4.multiply(projViewMat,projMat,viewMat)}function capzoom(){let e=Math.sqrt(Number.MAX_VALUE),t=1/e;Zoom<=t&&(Zoom=t),Zoom>=e&&(Zoom=e),(1.5*Zoom<lastZoom||Zoom>1.5*lastZoom)&&(remesh=!0,lastZoom=Zoom)}function zoomImage(e){let t=zoomStep*halfCanvasHeight*e;const i=Math.log(.1*Number.MAX_VALUE)/Math.log(zoomFactor);Math.abs(t)<i&&(Zoom*=zoomFactor**t,capzoom())}function normMouse(e){let t=e[0],i=e[1],a=Math.hypot(t,i);return a>1&&(denom=1/a,t*=denom,i*=denom),[t,i,Math.sqrt(Math.max(1-i*i-t*t,0))]}function arcball(e,t){let i=normMouse(e),a=normMouse(t),n=dot(i,a);return[n>1?0:n<-1?pi:Math.acos(n),unit(cross(i,a))]}function zoomScene(e,t,i,a){zoomImage(t-a)}const DRAGMODE_ROTATE=1,DRAGMODE_SHIFT=2,DRAGMODE_ZOOM=3,DRAGMODE_PAN=4;function processDrag(e,t,i,a=1){let n;switch(i){case 1:n=rotateScene;break;case 2:n=shiftScene;break;case 3:n=zoomScene;break;case 4:n=panScene;break;default:n=(e,t,i,a)=>{}}n((lastMouseX-halfCanvasWidth)/halfCanvasWidth,(lastMouseY-halfCanvasHeight)/halfCanvasHeight,(e-halfCanvasWidth)/halfCanvasWidth,(t-halfCanvasHeight)/halfCanvasHeight,a),lastMouseX=e,lastMouseY=t,setProjection(),drawScene()}let zoomEnabled=0;function enableZoom(){zoomEnabled=1,canvas.addEventListener("wheel",handleMouseWheel,!1)}function disableZoom(){zoomEnabled=0,canvas.removeEventListener("wheel",handleMouseWheel,!1)}function Camera(){let e=Array(3),t=Array(3),i=Array(3),a=center.x,n=center.y,r=.5*(viewParam.zmin+viewParam.zmax);for(let s=0;s<3;++s){let o=0,l=0,h=0,c=4*s;for(let e=0;e<4;++e){let t=4*e,i=rotMat[t],s=rotMat[t+1],d=rotMat[t+2],m=rotMat[t+3],f=Transform[c+e];o+=f*(m-a*i-n*s-r*d),h+=f*s,l+=f*(m-a*i-n*s)}e[s]=o,t[s]=h,i[s]=l}return[e,t,i]}function projection(){if(null==Transform)return"";let e,t,i;[e,t,i]=Camera();let a=orthographic?" orthographic(":" perspective(",n="".padStart(a.length),r="currentprojection=\n"+a+"camera=("+e+"),\n"+n+"up=("+t+"),\n"+n+"target=("+i+"),\n"+n+"zoom="+Zoom*initialZoom/zoom0;return orthographic||(r+=",\n"+n+"angle="+2*Math.atan(Math.tan(.5*angleOfView)/Zoom)/radians),0==xshift&&0==yshift||(r+=",\n"+n+"viewportshift=("+xshift+","+yshift+")"),orthographic||(r+=",\n"+n+"autoadjust=false"),r+=");\n",window.parent.asyProjection=!0,r}function handleKey(e){if(zoomEnabled||enableZoom(),embedded&&zoomEnabled&&27==e.keyCode)return void disableZoom();let t=[];switch(e.key){case"x":t=[1,0,0];break;case"y":t=[0,1,0];break;case"z":t=[0,0,1];break;case"h":home();break;case"m":++wireframe,3==wireframe&&(wireframe=0),2!=wireframe&&(embedded||deleteShaders(),initShaders(ibl)),remesh=!0,drawScene();break;case"+":case"=":case">":expand();break;case"-":case"_":case"<":shrink();break;case"c":showCamera()}t.length>0&&(mat4.rotate(rotMat,rotMat,.1,t),updateViewMatrix(),drawScene())}function setZoom(){capzoom(),setProjection(),drawScene()}function handleMouseWheel(e){e.preventDefault(),e.deltaY<0?Zoom*=zoomFactor:Zoom/=zoomFactor,setZoom()}function handleMouseMove(e){if(!mouseDownOrTouchActive)return;let t,i=e.clientX,a=e.clientY;t=e.getModifierState("Control")?2:e.getModifierState("Shift")?3:e.getModifierState("Alt")?4:1,processDrag(i,a,t)}let zooming=!1,swipe=!1,rotate=!1;function handleTouchMove(e){if(e.preventDefault(),zooming)return;let t=e.targetTouches;if(!pinch&&1==t.length&&touchId==t[0].identifier){let e=t[0].pageX,i=t[0].pageY,a=e-lastMouseX,n=i-lastMouseY,r=a*a+n*n<=shiftHoldDistance*shiftHoldDistance;if(r&&!swipe&&!rotate&&(new Date).getTime()-touchStartTime>shiftWaitTime&&(navigator.vibrate&&window.navigator.vibrate(vibrateTime),swipe=!0),swipe)processDrag(e,i,2);else if(!r){rotate=!0,processDrag(t[0].pageX,t[0].pageY,1,.5)}}if(pinch&&!swipe&&2==t.length&&touchId==t[0].identifier){let e=pinchDistance(t),i=e-pinchStart;zooming=!0,i*=zoomPinchFactor,i>zoomPinchCap&&(i=zoomPinchCap),i<-zoomPinchCap&&(i=-zoomPinchCap),zoomImage(i/size2),pinchStart=e,swipe=rotate=zooming=!1,setProjection(),drawScene()}}let pixelShader,materialShader,colorShader,transparentShader,zbuffer=[];function transformVertices(e){let t=viewMat[2],i=viewMat[6],a=viewMat[10];zbuffer.length=e.length;for(let n=0;n<e.length;++n){let r=6*n;zbuffer[n]=t*e[r]+i*e[r+1]+a*e[r+2]}}function drawMaterial0(){drawBuffer(material0Data,pixelShader),material0Data.clear()}function drawMaterial1(){drawBuffer(material1Data,materialShader),material1Data.clear()}function drawMaterial(){drawBuffer(materialData,materialShader),materialData.clear()}function drawColor(){drawBuffer(colorData,colorShader),colorData.clear()}function drawTriangle(){drawBuffer(triangleData,transparentShader),triangleData.rendered=!1,triangleData.clear()}function drawTransparent(){let e=transparentData.indices;if(wireframe>0)return drawBuffer(transparentData,transparentShader,e),void transparentData.clear();if(e.length>0){transformVertices(transparentData.vertices);let t=e.length/3,i=Array(t).fill().map((e,t)=>t);i.sort((function(t,i){let a=3*t;Ia=e[a],Ib=e[a+1],Ic=e[a+2];let n=3*i;return IA=e[n],IB=e[n+1],IC=e[n+2],zbuffer[Ia]+zbuffer[Ib]+zbuffer[Ic]<zbuffer[IA]+zbuffer[IB]+zbuffer[IC]?-1:1}));let a=Array(e.length);for(let n=0;n<t;++n){let t=3*i[n];a[3*n]=e[t],a[3*n+1]=e[t+1],a[3*n+2]=e[t+2]}gl.depthMask(!1),drawBuffer(transparentData,transparentShader,a),transparentData.rendered=!1,gl.depthMask(!0)}transparentData.clear()}function drawBuffers(){drawMaterial0(),drawMaterial1(),drawMaterial(),drawColor(),drawTriangle(),drawTransparent(),requestAnimationFrame(drawBuffers)}function drawScene(){embedded&&(offscreen.width=canvasWidth,offscreen.height=canvasHeight,setViewport()),gl.clearColor(Background[0],Background[1],Background[2],Background[3]),gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT);for(let e=0;e<P.length;++e)P[e].render();drawBuffers(),embedded&&(context.clearRect(0,0,canvasWidth,canvasHeight),context.drawImage(offscreen,0,0)),0==wireframe&&(remesh=!1)}function setDimensions(e,t,i,a){let n=e/t;xshift=(i/e+viewportShift[0])*Zoom,yshift=(a/t+viewportShift[1])*Zoom;let r=1/Zoom;if(orthographic){let e=maxBound[0]-minBound[0],t=maxBound[1]-minBound[1];if(e<t*n){let e=.5*t*n*r,i=2*e*xshift,a=t*r*yshift;viewParam.xmin=-e-i,viewParam.xmax=e-i,viewParam.ymin=minBound[1]*r-a,viewParam.ymax=maxBound[1]*r-a}else{let t=.5*e*r/n,i=e*r*xshift,a=2*t*yshift;viewParam.xmin=minBound[0]*r-i,viewParam.xmax=maxBound[0]*r-i,viewParam.ymin=-t-a,viewParam.ymax=t-a}}else{let e=H*r,t=e*n,i=2*t*xshift,a=2*e*yshift;viewParam.xmin=-t-i,viewParam.xmax=t-i,viewParam.ymin=-e-a,viewParam.ymax=e-a}}function setProjection(){setDimensions(canvasWidth,canvasHeight,shift.x,shift.y),(orthographic?mat4.ortho:mat4.frustum)(projMat,viewParam.xmin,viewParam.xmax,viewParam.ymin,viewParam.ymax,-viewParam.zmax,-viewParam.zmin),updateViewMatrix(),window.top.asyWebApplication&&window.top.asyWebApplication.setProjection(projection())}function showCamera(){window.top.asyWebApplication||prompt("Ctrl+c Enter to copy currentprojection to clipboard; then append to asy file:",projection())}function initProjection(){H=-Math.tan(.5*angleOfView)*maxBound[2],center.x=center.y=0,center.z=.5*(minBound[2]+maxBound[2]),lastZoom=Zoom=zoom0,viewParam.zmin=minBound[2],viewParam.zmax=maxBound[2],shift.x=shift.y=0}function setViewport(){gl.viewportWidth=canvasWidth,gl.viewportHeight=canvasHeight,gl.viewport(.5*(canvas.width-canvasWidth),.5*(canvas.height-canvasHeight),canvasWidth,canvasHeight),gl.scissor(0,0,canvas.width,canvas.height)}function setCanvas(){embedded&&(canvas.width=offscreen.width=canvasWidth,canvas.height=offscreen.height=canvasHeight),size2=Math.hypot(canvasWidth,canvasHeight),halfCanvasWidth=.5*canvas.width,halfCanvasHeight=.5*canvas.height,ArcballFactor=1+8*Math.hypot(viewportMargin[0],viewportMargin[1])/size2}function setsize(e,t){e>maxViewportWidth&&(e=maxViewportWidth),t>maxViewportHeight&&(t=maxViewportHeight),shift.x*=e/canvasWidth,shift.y*=t/canvasHeight,canvasWidth=e,canvasHeight=t,setCanvas(),setViewport(),setProjection(),remesh=!0}function resize(){if(zoom0=initialZoom,window.top.asyWebApplication&&""==window.top.asyWebApplication.getProjection()&&(window.parent.asyProjection=!1),absolute&&!embedded)canvasWidth=canvasWidth0*window.devicePixelRatio,canvasHeight=canvasHeight0*window.devicePixelRatio;else{let e=canvasWidth0/canvasHeight0;canvasWidth=Math.max(window.innerWidth-10,10),canvasHeight=Math.max(window.innerHeight-10,10),!orthographic&&!window.parent.asyProjection&&canvasWidth<canvasHeight*e&&(zoom0*=canvasWidth/(canvasHeight*e))}canvas.width=canvasWidth,canvas.height=canvasHeight;window.innerWidth,window.innerHeight;let e=1/zoom0;viewportShift[0]*=e,viewportShift[1]*=e,setsize(canvasWidth,canvasHeight),redrawScene()}function expand(){Zoom*=zoomFactor,setZoom()}function shrink(){Zoom/=zoomFactor,setZoom()}class Align{constructor(e,t){if(this.center=e,t){let e=t[0],i=t[1];this.ct=Math.cos(e),this.st=Math.sin(e),this.cp=Math.cos(i),this.sp=Math.sin(i)}}T0(e){return[e[0]+this.center[0],e[1]+this.center[1],e[2]+this.center[2]]}T(e){let t=e[0],i=e[1],a=e[2],n=t*this.ct+a*this.st;return[n*this.cp-i*this.sp+this.center[0],n*this.sp+i*this.cp+this.center[1],-t*this.st+a*this.ct+this.center[2]]}}function Tcorners(e,t,i){let a=[e(t),e([t[0],t[1],i[2]]),e([t[0],i[1],t[2]]),e([t[0],i[1],i[2]]),e([i[0],t[1],t[2]]),e([i[0],t[1],i[2]]),e([i[0],i[1],t[2]]),e(i)];return[minbound(a),maxbound(a)]}function material(e,t,i,a,n,r){Materials.push(new Material(e,t,i,a,n,r))}function patch(e,t,i,a,n,r){P.push(new BezierPatch(e,t,i,a,n,r))}function curve(e,t,i,a,n){P.push(new BezierCurve(e,t,i,a,n))}function pixel(e,t,i,a,n){P.push(new Pixel(e,t,i,a,n))}function triangles(e,t,i,a){P.push(new Triangles(e,t,i,a))}function sphere(e,t,i,n,r){let s,o,l,h,c,d,m=.524670512339254,f=.595936986722291,u=.954967051233925,p=.0820155480083437,g=.996685028842544,v=.0549670512339254,x=.998880711874577,w=.0405017186586849,M=[[[1,0,0],[1,0,m],[f,0,u],[p,0,g],[1,a,0],[1,a,m],[f,a*f,u],[p,a*p,g],[a,1,0],[a,1,m],[a*f,f,u],[a*p,p,g],[0,1,0],[0,1,m],[0,f,u],[0,p,g]],[[p,0,g],[p,a*p,g],[v,0,x],[a*p,p,g],[w,w,1],[.05*a,0,1],[0,p,g],[0,v,x],[0,.05*a,1],[0,0,1]]],b=new Align(e,r);function T(e){let t=Array(e.length);for(let i=0;i<e.length;++i){let a=e[i];t[i]=c([s*a[0],o*a[1],l*a[2]])}return t}r?(h=1,d=0,c=b.T.bind(b)):(h=-1,d=-t,c=b.T0.bind(b));let S=Tcorners(c,[-t,-t,d],[t,t,t]),R=S[0],A=S[1];for(let e=-1;e<=1;e+=2){s=e*t;for(let e=-1;e<=1;e+=2){o=e*t;for(let e=h;e<=1;e+=2){l=e*t;for(let e=0;e<2;++e)P.push(new BezierPatch(T(M[e]),i,n,R,A))}}}}let a=4/3*(Math.sqrt(2)-1);function disk(e,t,i,n,r){let s=1-2*a/3,o=[[1,0,0],[1,-a,0],[a,-1,0],[0,-1,0],[1,a,0],[s,0,0],[0,-s,0],[-a,-1,0],[a,1,0],[0,s,0],[-s,0,0],[-1,-a,0],[0,1,0],[-a,1,0],[-1,a,0],[-1,0,0]],l=new Align(e,r);let h=Tcorners(l.T.bind(l),[-t,-t,0],[t,t,0]);P.push(new BezierPatch(function(e){let i=Array(e.length);for(let a=0;a<e.length;++a){let n=e[a];i[a]=l.T([t*n[0],t*n[1],0])}return i}(o),i,n,h[0],h[1]))}function cylinder(e,t,i,n,r,s,o){let l,h,c=[[1,0,0],[1,0,1/3],[1,0,2/3],[1,0,1],[1,a,0],[1,a,1/3],[1,a,2/3],[1,a,1],[a,1,0],[a,1,1/3],[a,1,2/3],[a,1,1],[0,1,0],[0,1,1/3],[0,1,2/3],[0,1,1]],d=new Align(e,s);function m(e){let t=Array(e.length);for(let a=0;a<e.length;++a){let n=e[a];t[a]=d.T([l*n[0],h*n[1],i*n[2]])}return t}let f=Tcorners(d.T.bind(d),[-t,-t,0],[t,t,i]),u=f[0],p=f[1];for(let e=-1;e<=1;e+=2){l=e*t;for(let e=-1;e<=1;e+=2)h=e*t,P.push(new BezierPatch(m(c),n,r,u,p))}if(o){let t=d.T([0,0,i]);P.push(new BezierCurve([e,t],n,r,e,t))}}function rmf(e,t,i,a,n){class r{constructor(e,t,i){this.p=e,this.r=t,this.t=i,this.s=cross(i,t)}}let s=Number.EPSILON*Math.max(abs2(e),abs2(t),abs2(i),abs2(a));function o(n){if(1==n){let n=[a[0]-i[0],a[1]-i[1],a[2]-i[2]];return abs2(n)>s?unit(n):(n=[2*i[0]-t[0]-a[0],2*i[1]-t[1]-a[1],2*i[2]-t[2]-a[2]],abs2(n)>s?unit(n):[a[0]-e[0]+3*(t[0]-i[0]),a[1]-e[1]+3*(t[1]-i[1]),a[2]-e[2]+3*(t[2]-i[2])])}let r=[a[0]-e[0]+3*(t[0]-i[0]),a[1]-e[1]+3*(t[1]-i[1]),a[2]-e[2]+3*(t[2]-i[2])],o=[2*(e[0]+i[0])-4*t[0],2*(e[1]+i[1])-4*t[1],2*(e[2]+i[2])-4*t[2]],l=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],h=n*n,c=[r[0]*h+o[0]*n+l[0],r[1]*h+o[1]*n+l[1],r[2]*h+o[2]*n+l[2]];return abs2(c)>s?unit(c):(h=2*n,c=[r[0]*h+o[0],r[1]*h+o[1],r[2]*h+o[2]],abs2(c)>s?unit(c):unit(r))}let l=Array(n.length),h=[t[0]-e[0],t[1]-e[1],t[2]-e[2]];abs2(h)<s&&(h=[e[0]-2*t[0]+i[0],e[1]-2*t[1]+i[1],e[2]-2*t[2]+i[2]],abs2(h)<s&&(h=[a[0]-e[0]+3*(t[0]-i[0]),a[1]-e[1]+3*(t[1]-i[1]),a[2]-e[2]+3*(t[2]-i[2])])),h=unit(h);let c=function(e){let t=cross(e,[0,1,0]),i=Number.EPSILON*abs2(e);return abs2(t)>i?unit(t):(t=cross(e,[0,0,1]),abs2(t)>i?unit(t):[1,0,0])}(h);l[0]=new r(e,c,h);for(let s=1;s<n.length;++s){let h=l[s-1],c=n[s],d=1-c,m=d*d,f=m*d,u=3*c;m*=u,d*=u*c;let p=c*c*c,g=[f*e[0]+m*t[0]+d*i[0]+p*a[0],f*e[1]+m*t[1]+d*i[1]+p*a[1],f*e[2]+m*t[2]+d*i[2]+p*a[2]],v=[g[0]-h.p[0],g[1]-h.p[1],g[2]-h.p[2]];if(0!=v[0]||0!=v[1]||0!=v[2]){let e=h.r,t=unit(v),i=h.t,a=dot(t,i),n=[i[0]-2*a*t[0],i[1]-2*a*t[1],i[2]-2*a*t[2]];i=o(c);let d=2*dot(t,e),m=[e[0]-d*t[0],e[1]-d*t[1],e[2]-d*t[2]],f=unit([i[0]-n[0],i[1]-n[1],i[2]-n[2]]),u=2*dot(f,m);m=[m[0]-u*f[0],m[1]-u*f[1],m[2]-u*f[2]],l[s]=new r(g,unit(m),unit(i))}else l[s]=l[s-1]}return l}function tube(e,t,i,n,r,s,o){let l=rmf(e[0],e[1],e[2],e[3],[0,1/3,2/3,1]),h=a*t,c=[[t,0],[t,h],[h,t],[0,t]];function d(t,a,o,h){let d=Array(16);for(let i=0;i<4;++i){let n=l[i],r=n.r[0],s=n.s[0],m=r*t+s*a,f=r*o+s*h;r=n.r[1],s=n.s[1];let u=r*t+s*a,p=r*o+s*h;r=n.r[2],s=n.s[2];let g=r*t+s*a,v=r*o+s*h,x=e[i],w=x[0];w1=x[1],w2=x[2];for(let e=0;e<4;++e){let t=c[e],a=t[0],n=t[1];d[4*i+e]=[m*a+f*n+w,u*a+p*n+w1,g*a+v*n+w2]}}P.push(new BezierPatch(d,i,n,r,s))}d(1,0,0,1),d(0,-1,1,0),d(-1,0,0,-1),d(0,1,-1,0),o&&P.push(new BezierCurve(e,i,n,r,s))}async function getReq(e){return(await fetch(e)).arrayBuffer()}function rgb(e){return e.getBytes().filter((e,t)=>t%4!=3)}function createTexture(e,t,i=gl.RGB16F){let a=e.width(),n=e.height(),r=gl.createTexture();return gl.activeTexture(gl.TEXTURE0+t),gl.bindTexture(gl.TEXTURE_2D,r),gl.pixelStorei(gl.UNPACK_ALIGNMENT,1),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR),gl.texImage2D(gl.TEXTURE_2D,0,i,a,n,0,gl.RGB,gl.FLOAT,rgb(e)),r}async function initIBL(){let e=imageURL+image+"/";function t(e){return new Promise(t=>setTimeout(t,e))}for(;!Module.EXRLoader;)await t(0);promises=[getReq(imageURL+"refl.exr").then(e=>{let t=new Module.EXRLoader(e);IBLbdrfMap=createTexture(t,0)}),getReq(e+"diffuse.exr").then(e=>{let t=new Module.EXRLoader(e);IBLDiffuseMap=createTexture(t,1)})],refl_promise=[],refl_promise.push(getReq(e+"refl0.exr"));for(let t=1;t<=roughnessStepCount;++t)refl_promise.push(getReq(e+"refl"+t+"w.exr"));finished_promise=Promise.all(refl_promise).then(e=>{let t=gl.createTexture();gl.activeTexture(gl.TEXTURE0+2),gl.pixelStorei(gl.UNPACK_ALIGNMENT,1),gl.bindTexture(gl.TEXTURE_2D,t),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAX_LEVEL,e.length-1),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MIN_FILTER,gl.LINEAR_MIPMAP_LINEAR),gl.texParameteri(gl.TEXTURE_2D,gl.TEXTURE_MAG_FILTER,gl.LINEAR),gl.texParameterf(gl.TEXTURE_2D,gl.TEXTURE_MIN_LOD,0),gl.texParameterf(gl.TEXTURE_2D,gl.TEXTURE_MAX_LOD,roughnessStepCount);for(let t=0;t<e.length;++t){let i=new Module.EXRLoader(e[t]);gl.texImage2D(gl.TEXTURE_2D,t,gl.RGB16F,i.width(),i.height(),0,gl.RGB,gl.FLOAT,rgb(i))}IBLReflMap=t}),promises.push(finished_promise),await Promise.all(promises)}function webGLStart(){canvas=document.getElementById("Asymptote"),embedded=window.top.document!=document,initGL(),gl.enable(gl.BLEND),gl.blendFunc(gl.SRC_ALPHA,gl.ONE_MINUS_SRC_ALPHA),gl.enable(gl.DEPTH_TEST),gl.enable(gl.SCISSOR_TEST),canvas.onmousedown=handleMouseDown,document.onmouseup=handleMouseUpOrTouchEnd,document.onmousemove=handleMouseMove,canvas.onkeydown=handleKey,embedded||enableZoom(),canvas.addEventListener("touchstart",handleTouchStart,!1),canvas.addEventListener("touchend",handleMouseUpOrTouchEnd,!1),canvas.addEventListener("touchcancel",handleMouseUpOrTouchEnd,!1),canvas.addEventListener("touchleave",handleMouseUpOrTouchEnd,!1),canvas.addEventListener("touchmove",handleTouchMove,!1),document.addEventListener("keydown",handleKey,!1),canvasWidth0=canvasWidth,canvasHeight0=canvasHeight,mat4.identity(rotMat),0!=window.innerWidth&&0!=window.innerHeight&&resize(),window.addEventListener("resize",resize,!1),ibl&&initIBL().then(SetIBL).then(redrawScene)} +let vertex="\n#ifdef WEBGL2\n#define IN in\n#define OUT out\n#else\n#define IN attribute\n#define OUT varying\n#endif\n\nIN vec3 position;\n#ifdef WIDTH\nIN float width;\n#endif\n#ifdef NORMAL\nIN vec3 normal;\n#endif\n\nIN float materialIndex;\n\n#ifdef WEBGL2\nflat out int MaterialIndex;\n#ifdef COLOR\nOUT vec4 Color;\n#endif\n\n#else\nOUT vec4 diffuse;\nOUT vec3 specular;\nOUT float roughness,metallic,fresnel0;\nOUT vec4 emissive;\n\nstruct Material {\n vec4 diffuse,emissive,specular;\n vec4 parameters;\n};\n\nuniform Material Materials[Nmaterials];\n#endif\n\n#ifdef COLOR\nIN vec4 color;\n#endif\n\nuniform mat3 normMat;\nuniform mat4 viewMat;\nuniform mat4 projViewMat;\n\n#ifdef NORMAL\n#ifndef ORTHOGRAPHIC\nOUT vec3 ViewPosition;\n#endif\nOUT vec3 Normal;\n#endif\n\nvoid main(void)\n{\n vec4 v=vec4(position,1.0);\n gl_Position=projViewMat*v;\n\n#ifdef NORMAL\n#ifndef ORTHOGRAPHIC\n ViewPosition=(viewMat*v).xyz;\n#endif\n Normal=normalize(normal*normMat);\n#endif\n\n#ifdef WEBGL2\n MaterialIndex=int(materialIndex);\n#ifdef COLOR\n Color=color;\n#endif\n#else\n#ifdef NORMAL\n Material m;\n#ifdef TRANSPARENT\n m=Materials[int(abs(materialIndex))-1];\n emissive=m.emissive;\n if(materialIndex >= 0.0)\n diffuse=m.diffuse;\n else {\n diffuse=color;\n#if nlights == 0\n emissive += color;\n#endif\n }\n#else\n m=Materials[int(materialIndex)];\n emissive=m.emissive;\n#ifdef COLOR\n diffuse=color;\n#if nlights == 0\n emissive += color;\n#endif\n#else\n diffuse=m.diffuse;\n#endif // COLOR\n#endif // TRANSPARENT\n specular=m.specular.rgb;\n vec4 parameters=m.parameters;\n roughness=1.0-parameters[0];\n metallic=parameters[1];\n fresnel0=parameters[2];\n#else\n emissive=Materials[int(materialIndex)].emissive;\n#endif // NORMAL\n#endif // WEBGL2\n\n#ifdef WIDTH\n gl_PointSize=width;\n#endif\n}\n",fragment="\n#ifdef WEBGL2\n#define IN in\nout vec4 outValue;\n#define OUTVALUE outValue\n#else\n#define IN varying\n#define OUTVALUE gl_FragColor\n#endif\n\n#ifdef WEBGL2\nflat in int MaterialIndex;\n\nstruct Material {\n vec4 diffuse,emissive,specular;\n vec4 parameters;\n};\n\nuniform Material Materials[Nmaterials];\n\nvec4 diffuse;\nvec3 specular;\nfloat roughness,metallic,fresnel0;\nvec4 emissive;\n\n#ifdef COLOR\nin vec4 Color;\n#endif\n\n#else\nIN vec4 diffuse;\nIN vec3 specular;\nIN float roughness,metallic,fresnel0;\nIN vec4 emissive;\n#endif\n\n#ifdef NORMAL\n\n#ifndef ORTHOGRAPHIC\nIN vec3 ViewPosition;\n#endif\nIN vec3 Normal;\n\nvec3 normal;\n\nstruct Light {\n vec3 direction;\n vec3 color;\n};\n\nuniform Light Lights[Nlights];\n\n#ifdef USE_IBL\nuniform sampler2D reflBRDFSampler;\nuniform sampler2D diffuseSampler;\nuniform sampler2D reflImgSampler;\n\nconst float pi=acos(-1.0);\nconst float piInv=1.0/pi;\nconst float twopi=2.0*pi;\nconst float twopiInv=1.0/twopi;\n\n// (x,y,z) -> (r,theta,phi);\n// theta -> [0,pi]: colatitude\n// phi -> [-pi,pi]: longitude\nvec3 cart2sphere(vec3 cart)\n{\n float x=cart.x;\n float y=cart.z;\n float z=cart.y;\n\n float r=length(cart);\n float theta=r > 0.0 ? acos(z/r) : 0.0;\n float phi=atan(y,x);\n\n return vec3(r,theta,phi);\n}\n\nvec2 normalizedAngle(vec3 cartVec)\n{\n vec3 sphericalVec=cart2sphere(cartVec);\n sphericalVec.y=sphericalVec.y*piInv;\n sphericalVec.z=0.75-sphericalVec.z*twopiInv;\n return sphericalVec.zy;\n}\n\nvec3 IBLColor(vec3 viewDir)\n{\n vec3 IBLDiffuse=diffuse.rgb*texture(diffuseSampler,normalizedAngle(normal)).rgb;\n vec3 reflectVec=normalize(reflect(-viewDir,normal));\n vec2 reflCoord=normalizedAngle(reflectVec);\n vec3 IBLRefl=textureLod(reflImgSampler,reflCoord,roughness*ROUGHNESS_STEP_COUNT).rgb;\n vec2 IBLbrdf=texture(reflBRDFSampler,vec2(dot(normal,viewDir),roughness)).rg;\n float specularMultiplier=fresnel0*IBLbrdf.x+IBLbrdf.y;\n vec3 dielectric=IBLDiffuse+specularMultiplier*IBLRefl;\n vec3 metal=diffuse.rgb*IBLRefl;\n return mix(dielectric,metal,metallic);\n}\n#else\nfloat Roughness2;\nfloat NDF_TRG(vec3 h)\n{\n float ndoth=max(dot(normal,h),0.0);\n float alpha2=Roughness2*Roughness2;\n float denom=ndoth*ndoth*(alpha2-1.0)+1.0;\n return denom != 0.0 ? alpha2/(denom*denom) : 0.0;\n}\n\nfloat GGX_Geom(vec3 v)\n{\n float ndotv=max(dot(v,normal),0.0);\n float ap=1.0+Roughness2;\n float k=0.125*ap*ap;\n return ndotv/((ndotv*(1.0-k))+k);\n}\n\nfloat Geom(vec3 v, vec3 l)\n{\n return GGX_Geom(v)*GGX_Geom(l);\n}\n\nfloat Fresnel(vec3 h, vec3 v, float fresnel0)\n{\n float a=1.0-max(dot(h,v),0.0);\n float b=a*a;\n return fresnel0+(1.0-fresnel0)*b*b*a;\n}\n\n// physical based shading using UE4 model.\nvec3 BRDF(vec3 viewDirection, vec3 lightDirection)\n{\n vec3 lambertian=diffuse.rgb;\n vec3 h=normalize(lightDirection+viewDirection);\n\n float omegain=max(dot(viewDirection,normal),0.0);\n float omegaln=max(dot(lightDirection,normal),0.0);\n\n float D=NDF_TRG(h);\n float G=Geom(viewDirection,lightDirection);\n float F=Fresnel(h,viewDirection,fresnel0);\n\n float denom=4.0*omegain*omegaln;\n float rawReflectance=denom > 0.0 ? (D*G)/denom : 0.0;\n\n vec3 dielectric=mix(lambertian,rawReflectance*specular,F);\n vec3 metal=rawReflectance*diffuse.rgb;\n\n return mix(dielectric,metal,metallic);\n}\n#endif\n\n#endif\n\nvoid main(void)\n{\n#ifdef WEBGL2\n#ifdef NORMAL\n Material m;\n#ifdef TRANSPARENT\n m=Materials[abs(MaterialIndex)-1];\n emissive=m.emissive;\n if(MaterialIndex >= 0)\n diffuse=m.diffuse;\n else {\n diffuse=Color;\n#if nlights == 0\n emissive += Color;\n#endif\n }\n#else\n m=Materials[MaterialIndex];\n emissive=m.emissive;\n#ifdef COLOR\n diffuse=Color;\n#if nlights == 0\n emissive += Color;\n#endif\n#else\n diffuse=m.diffuse;\n#endif // COLOR\n#endif // TRANSPARENT\n specular=m.specular.rgb;\n vec4 parameters=m.parameters;\n roughness=1.0-parameters[0];\n metallic=parameters[1];\n fresnel0=parameters[2];\n#else\n emissive=Materials[MaterialIndex].emissive;\n#endif // NORMAL\n#endif // WEBGL2\n\n#if defined(NORMAL) && nlights > 0\n normal=normalize(Normal);\n normal=gl_FrontFacing ? normal : -normal;\n#ifdef ORTHOGRAPHIC\n vec3 viewDir=vec3(0.0,0.0,1.0);\n#else\n vec3 viewDir=-normalize(ViewPosition);\n#endif\n\nvec3 color;\n#ifdef USE_IBL\n color=IBLColor(viewDir);\n#else\n Roughness2=roughness*roughness;\n color=emissive.rgb;\n for(int i=0; i < nlights; ++i) {\n Light Li=Lights[i];\n vec3 L=Li.direction;\n float cosTheta=max(dot(normal,L),0.0);\n vec3 radiance=cosTheta*Li.color;\n color += BRDF(viewDir,L)*radiance;\n }\n#endif\n OUTVALUE=vec4(color,diffuse.a);\n#else\n OUTVALUE=emissive;\n#endif\n}\n";!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.setMatrixArrayType=function(t){e.ARRAY_TYPE=t},e.toRadian=function(t){return t*r},e.equals=function(t,e){return Math.abs(t-e)<=n*Math.max(1,Math.abs(t),Math.abs(e))};var n=e.EPSILON=1e-6;e.ARRAY_TYPE="undefined"!=typeof Float32Array?Float32Array:Array,e.RANDOM=Math.random;var r=Math.PI/180},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mat4=e.mat3=void 0;var n=s(i(2)),r=s(i(3));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}e.mat3=n,e.mat4=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=function(){var t=new n.ARRAY_TYPE(9);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},e.fromMat4=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t},e.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],d=c*a-o*l,m=-c*s+o*h,f=l*s-a*h,u=i*d+n*m+r*f;if(!u)return null;return u=1/u,t[0]=d*u,t[1]=(-c*n+r*l)*u,t[2]=(o*n-r*a)*u,t[3]=m*u,t[4]=(c*i-r*h)*u,t[5]=(-o*i+r*s)*u,t[6]=f*u,t[7]=(-l*i+n*h)*u,t[8]=(a*i-n*s)*u,t};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(i(0))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=function(){var t=new n.ARRAY_TYPE(16);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.identity=function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.invert=function(t,e){var i=e[0],n=e[1],r=e[2],s=e[3],a=e[4],o=e[5],h=e[6],l=e[7],c=e[8],d=e[9],m=e[10],f=e[11],u=e[12],p=e[13],v=e[14],x=e[15],g=i*o-n*a,w=i*h-r*a,M=i*l-s*a,b=n*h-r*o,R=n*l-s*o,T=r*l-s*h,y=c*p-d*u,A=c*v-m*u,E=c*x-f*u,I=d*v-m*p,L=d*x-f*p,N=m*x-f*v,O=g*N-w*L+M*I+b*E-R*A+T*y;if(!O)return null;return O=1/O,t[0]=(o*N-h*L+l*I)*O,t[1]=(r*L-n*N-s*I)*O,t[2]=(p*T-v*R+x*b)*O,t[3]=(m*R-d*T-f*b)*O,t[4]=(h*E-a*N-l*A)*O,t[5]=(i*N-r*E+s*A)*O,t[6]=(v*M-u*T-x*w)*O,t[7]=(c*T-m*M+f*w)*O,t[8]=(a*L-o*E+l*y)*O,t[9]=(n*E-i*L-s*y)*O,t[10]=(u*R-p*M+x*g)*O,t[11]=(d*M-c*R-f*g)*O,t[12]=(o*A-a*I-h*y)*O,t[13]=(i*I-n*A+r*y)*O,t[14]=(p*w-u*b-v*g)*O,t[15]=(c*b-d*w+m*g)*O,t},e.multiply=r,e.translate=function(t,e,i){var n=i[0],r=i[1],s=i[2],a=void 0,o=void 0,h=void 0,l=void 0,c=void 0,d=void 0,m=void 0,f=void 0,u=void 0,p=void 0,v=void 0,x=void 0;e===t?(t[12]=e[0]*n+e[4]*r+e[8]*s+e[12],t[13]=e[1]*n+e[5]*r+e[9]*s+e[13],t[14]=e[2]*n+e[6]*r+e[10]*s+e[14],t[15]=e[3]*n+e[7]*r+e[11]*s+e[15]):(a=e[0],o=e[1],h=e[2],l=e[3],c=e[4],d=e[5],m=e[6],f=e[7],u=e[8],p=e[9],v=e[10],x=e[11],t[0]=a,t[1]=o,t[2]=h,t[3]=l,t[4]=c,t[5]=d,t[6]=m,t[7]=f,t[8]=u,t[9]=p,t[10]=v,t[11]=x,t[12]=a*n+c*r+u*s+e[12],t[13]=o*n+d*r+p*s+e[13],t[14]=h*n+m*r+v*s+e[14],t[15]=l*n+f*r+x*s+e[15]);return t},e.rotate=function(t,e,i,r){var s,a,o,h,l,c,d,m,f,u,p,v,x,g,w,M,b,R,T,y,A,E,I,L,N=r[0],O=r[1],_=r[2],P=Math.sqrt(N*N+O*O+_*_);if(Math.abs(P)<n.EPSILON)return null;N*=P=1/P,O*=P,_*=P,s=Math.sin(i),a=Math.cos(i),o=1-a,h=e[0],l=e[1],c=e[2],d=e[3],m=e[4],f=e[5],u=e[6],p=e[7],v=e[8],x=e[9],g=e[10],w=e[11],M=N*N*o+a,b=O*N*o+_*s,R=_*N*o-O*s,T=N*O*o-_*s,y=O*O*o+a,A=_*O*o+N*s,E=N*_*o+O*s,I=O*_*o-N*s,L=_*_*o+a,t[0]=h*M+m*b+v*R,t[1]=l*M+f*b+x*R,t[2]=c*M+u*b+g*R,t[3]=d*M+p*b+w*R,t[4]=h*T+m*y+v*A,t[5]=l*T+f*y+x*A,t[6]=c*T+u*y+g*A,t[7]=d*T+p*y+w*A,t[8]=h*E+m*I+v*L,t[9]=l*E+f*I+x*L,t[10]=c*E+u*I+g*L,t[11]=d*E+p*I+w*L,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]);return t},e.fromTranslation=function(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t},e.fromRotation=function(t,e,i){var r,s,a,o=i[0],h=i[1],l=i[2],c=Math.sqrt(o*o+h*h+l*l);if(Math.abs(c)<n.EPSILON)return null;return o*=c=1/c,h*=c,l*=c,r=Math.sin(e),s=Math.cos(e),a=1-s,t[0]=o*o*a+s,t[1]=h*o*a+l*r,t[2]=l*o*a-h*r,t[3]=0,t[4]=o*h*a-l*r,t[5]=h*h*a+s,t[6]=l*h*a+o*r,t[7]=0,t[8]=o*l*a+h*r,t[9]=h*l*a-o*r,t[10]=l*l*a+s,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},e.frustum=function(t,e,i,n,r,s,a){var o=1/(i-e),h=1/(r-n),l=1/(s-a);return t[0]=2*s*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*s*h,t[6]=0,t[7]=0,t[8]=(i+e)*o,t[9]=(r+n)*h,t[10]=(a+s)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*s*2*l,t[15]=0,t},e.ortho=function(t,e,i,n,r,s,a){var o=1/(e-i),h=1/(n-r),l=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+i)*o,t[13]=(r+n)*h,t[14]=(a+s)*l,t[15]=1,t};var n=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(i(0));function r(t,e,i){var n=e[0],r=e[1],s=e[2],a=e[3],o=e[4],h=e[5],l=e[6],c=e[7],d=e[8],m=e[9],f=e[10],u=e[11],p=e[12],v=e[13],x=e[14],g=e[15],w=i[0],M=i[1],b=i[2],R=i[3];return t[0]=w*n+M*o+b*d+R*p,t[1]=w*r+M*h+b*m+R*v,t[2]=w*s+M*l+b*f+R*x,t[3]=w*a+M*c+b*u+R*g,w=i[4],M=i[5],b=i[6],R=i[7],t[4]=w*n+M*o+b*d+R*p,t[5]=w*r+M*h+b*m+R*v,t[6]=w*s+M*l+b*f+R*x,t[7]=w*a+M*c+b*u+R*g,w=i[8],M=i[9],b=i[10],R=i[11],t[8]=w*n+M*o+b*d+R*p,t[9]=w*r+M*h+b*m+R*v,t[10]=w*s+M*l+b*f+R*x,t[11]=w*a+M*c+b*u+R*g,w=i[12],M=i[13],b=i[14],R=i[15],t[12]=w*n+M*o+b*d+R*p,t[13]=w*r+M*h+b*m+R*v,t[14]=w*s+M*l+b*f+R*x,t[15]=w*a+M*c+b*u+R*g,t}}])})),function(){document.asy={canvasWidth:0,canvasHeight:0,absolute:!1,minBound:[0,0,0],maxBound:[0,0,0],orthographic:!1,angleOfView:0,initialZoom:0,viewportShift:[0,0],viewportMargin:[0,0],background:[],zoomFactor:0,zoomPinchFactor:0,zoomPinchCap:0,zoomStep:0,shiftHoldDistance:0,shiftWaitTime:0,vibrateTime:0,ibl:!1,webgl2:!1,imageURL:"",image:"",Transform:[],Centers:[]};let t,e,i,n,r,s,a,o=document.asy,h=[],l=[],c=[],d=0,m=2;const f=Math.acos(-1),u=f/180,p=Math.ceil(1-Math.log2(Number.EPSILON));let v,x,g,w,M,b,R,T=mat4.create(),y=mat4.create(),A=mat4.create(),E=mat4.create(),I=mat3.create(),L=mat3.create(),N=mat4.create(),O=mat4.create(),_={x:0,y:0,z:0},P={x:0,y:0},S={xmin:0,xmax:0,ymin:0,ymax:0,zmin:0,zmax:0},U=!0,V=0,B=!1,D=null,C=null,F=[],z=[],H=[],X=[],G=null,W=null,j=null;function k(){o.embedded||st(),rt(o.ibl)}class Y{constructor(t,e,i,n,r,s){this.diffuse=t,this.emissive=e,this.specular=i,this.shininess=n,this.metallic=r,this.fresnel0=s}setUniform(e,i){let n=n=>t.getUniformLocation(e,"Materials["+i+"]."+n);t.uniform4fv(n("diffuse"),new Float32Array(this.diffuse)),t.uniform4fv(n("emissive"),new Float32Array(this.emissive)),t.uniform4fv(n("specular"),new Float32Array(this.specular)),t.uniform4f(n("parameters"),this.shininess,this.metallic,this.fresnel0,0)}}let $,q,K,Z,Q,J,tt,et,it;class nt{constructor(t,e){this.direction=t,this.color=e}setUniform(e,i){let n=n=>t.getUniformLocation(e,"Lights["+i+"]."+n);t.uniform3fv(n("direction"),new Float32Array(this.direction)),t.uniform3fv(n("color"),new Float32Array(this.color))}}function rt(e=!1){let i=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS);r=Math.floor((i-14)/4),m=Math.min(Math.max(m,c.length),r),pixelOpt=["WIDTH"],materialOpt=["NORMAL"],colorOpt=["NORMAL","COLOR"],transparentOpt=["NORMAL","COLOR","TRANSPARENT"],e&&(materialOpt.push("USE_IBL"),transparentOpt.push("USE_IBL")),xe=Lt(pixelOpt),ge=Lt(materialOpt),we=Lt(colorOpt),Me=Lt(transparentOpt)}function st(){t.deleteProgram(Me),t.deleteProgram(we),t.deleteProgram(ge),t.deleteProgram(xe)}function at(){let i=o.webgl2?window.top.document.asygl2[e]:window.top.document.asygl[e];i.gl=t,i.nlights=l.length,i.Nmaterials=m,i.maxMaterials=r,i.pixelShader=xe,i.materialShader=ge,i.colorShader=we,i.transparentShader=Me}function ot(t,e){let i;return o.webgl2&&(i=t.getContext("webgl2",{alpha:e}),o.embedded&&!i)?(o.webgl2=!1,o.ibl=!1,ht(!1),null):(i||(o.webgl2=!1,o.ibl=!1,i=t.getContext("webgl",{alpha:e})),i||alert("Could not initialize WebGL"),i)}function ht(s=!0){if(o.ibl&&(o.webgl2=!0),e=o.background[3]<1,o.embedded){let a=window.top.document;if(s&&(n=o.canvas.getContext("2d")),i=o.webgl2?a.offscreen2:a.offscreen,i||(i=a.createElement("canvas"),o.webgl2?a.offscreen2=i:a.offscreen=i),o.webgl2?a.asygl2||(a.asygl2=Array(2)):a.asygl||(a.asygl=Array(2)),asygl=o.webgl2?a.asygl2:a.asygl,asygl[e]&&asygl[e].gl)!function(){let i=o.webgl2?window.top.document.asygl2[e]:window.top.document.asygl[e];t=i.gl,d=i.nlights,m=i.Nmaterials,r=i.maxMaterials,xe=i.pixelShader,ge=i.materialShader,we=i.colorShader,Me=i.transparentShader}(),(l.length!=d||Math.min(c.length,r)>m)&&(rt(),at());else{if(rc=ot(i,e),!rc)return;t=rc,rt(),o.webgl2?a.asygl2[e]={}:a.asygl[e]={},at()}}else t=ot(o.canvas,e),rt();$=t.getExtension("OES_element_index_uint"),q=t.TRIANGLES,K=new mt(t.POINTS),Z=new mt(t.LINES),Q=new mt,J=new mt,tt=new mt,et=new mt}function lt(t,e,i,n=[]){let r=o.webgl2?"300 es":"100",s=Array(...n),a=[["nlights",0==V?l.length:0],["Nmaterials",m]],h=[["int","Nlights",Math.max(l.length,1)]];o.webgl2&&s.push("WEBGL2"),o.ibl&&a.push(["ROUGHNESS_STEP_COUNT",8..toFixed(2)]),o.orthographic&&s.push("ORTHOGRAPHIC"),macros_str=a.map(t=>`#define ${t[0]} ${t[1]}`).join("\n"),define_str=s.map(t=>"#define "+t).join("\n"),const_str=h.map(t=>`const ${t[0]} ${t[1]}=${t[2]};`).join("\n"),ext_str=[].map(t=>`#extension ${t}: enable`).join("\n"),shaderSrc=`#version ${r}\n${ext_str}\n${define_str}\n${const_str}\n${macros_str}\n\n\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\n \n${e}\n `;let c=t.createShader(i);return t.shaderSource(c,shaderSrc),t.compileShader(c),t.getShaderParameter(c,t.COMPILE_STATUS)?c:(alert(t.getShaderInfoLog(c)),null)}function ct(e,i,n,r=t.ARRAY_BUFFER){return e.length>0&&(0==i&&(i=t.createBuffer(),n=!0),t.bindBuffer(r,i),n&&t.bufferData(r,e,t.STATIC_DRAW)),i}function dt(e,i,n=e.indices){if(0==e.indices.length)return;let r=i!=xe;!function(e,i){let n=i==xe;t.useProgram(i),t.enableVertexAttribArray(Tt),n&&t.enableVertexAttribArray(It);let r=!n&&l.length>0;r&&t.enableVertexAttribArray(yt);t.enableVertexAttribArray(At),i.projViewMatUniform=t.getUniformLocation(i,"projViewMat"),i.viewMatUniform=t.getUniformLocation(i,"viewMat"),i.normMatUniform=t.getUniformLocation(i,"normMat"),(i==we||i==Me)&&t.enableVertexAttribArray(Et);if(r)for(let t=0;t<l.length;++t)l[t].setUniform(i,t);for(let t=0;t<e.materials.length;++t)e.materials[t].setUniform(i,t);t.uniformMatrix4fv(i.projViewMatUniform,!1,E),t.uniformMatrix4fv(i.viewMatUniform,!1,A),t.uniformMatrix3fv(i.normMatUniform,!1,I)}(e,i),null!=W&&(t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,j),t.uniform1i(t.getUniformLocation(i,"reflBRDFSampler"),0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,W),t.uniform1i(t.getUniformLocation(i,"diffuseSampler"),1),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,G),t.uniform1i(t.getUniformLocation(i,"reflImgSampler"),2));let s=U||e.partial||!e.rendered;e.verticesBuffer=ct(new Float32Array(e.vertices),e.verticesBuffer,s),t.vertexAttribPointer(Tt,3,t.FLOAT,!1,r?24:16,0),r?l.length>0&&t.vertexAttribPointer(yt,3,t.FLOAT,!1,24,12):t.vertexAttribPointer(It,1,t.FLOAT,!1,16,12),e.materialsBuffer=ct(new Int16Array(e.materialIndices),e.materialsBuffer,s),t.vertexAttribPointer(At,1,t.SHORT,!1,2,0),i!=we&&i!=Me||(e.colorsBuffer=ct(new Float32Array(e.colors),e.colorsBuffer,s),t.vertexAttribPointer(Et,4,t.FLOAT,!0,0,0)),e.indicesBuffer=ct($?new Uint32Array(n):new Uint16Array(n),e.indicesBuffer,s,t.ELEMENT_ARRAY_BUFFER),e.rendered=!0,t.drawElements(r?V?t.LINES:e.type:t.POINTS,n.length,$?t.UNSIGNED_INT:t.UNSIGNED_SHORT,0)}class mt{constructor(t){this.type=t||q,this.verticesBuffer=0,this.materialsBuffer=0,this.colorsBuffer=0,this.indicesBuffer=0,this.rendered=!1,this.partial=!1,this.clear()}clear(){this.vertices=[],this.materialIndices=[],this.colors=[],this.indices=[],this.nvertices=0,this.materials=[],this.materialTable=[]}vertex(t,e){return this.vertices.push(t[0]),this.vertices.push(t[1]),this.vertices.push(t[2]),this.vertices.push(e[0]),this.vertices.push(e[1]),this.vertices.push(e[2]),this.materialIndices.push(it),this.nvertices++}Vertex(t,e,i=[0,0,0,0]){return this.vertices.push(t[0]),this.vertices.push(t[1]),this.vertices.push(t[2]),this.vertices.push(e[0]),this.vertices.push(e[1]),this.vertices.push(e[2]),this.materialIndices.push(it),this.colors.push(i[0]),this.colors.push(i[1]),this.colors.push(i[2]),this.colors.push(i[3]),this.nvertices++}vertex0(t,e){return this.vertices.push(t[0]),this.vertices.push(t[1]),this.vertices.push(t[2]),this.vertices.push(e),this.materialIndices.push(it),this.nvertices++}iVertex(t,e,i,n=[0,0,0,0]){let r=6*t;this.vertices[r]=e[0],this.vertices[r+1]=e[1],this.vertices[r+2]=e[2],this.vertices[r+3]=i[0],this.vertices[r+4]=i[1],this.vertices[r+5]=i[2],this.materialIndices[t]=it;let s=4*t;this.colors[s]=n[0],this.colors[s+1]=n[1],this.colors[s+2]=n[2],this.colors[s+3]=n[3],this.indices.push(t)}append(t){ft(this.vertices,t.vertices),ft(this.materialIndices,t.materialIndices),ft(this.colors,t.colors),function(t,e,i){let n=t.length,r=e.length;t.length+=e.length;for(let s=0;s<r;++s)t[n+s]=e[s]+i}(this.indices,t.indices,this.nvertices),this.nvertices+=t.nvertices}}function ft(t,e){let i=t.length,n=e.length;t.length+=n;for(let r=0;r<n;++r)t[i+r]=e[r]}class ut{constructor(){this.data=new mt,this.Onscreen=!1,this.m=[]}offscreen(t){let e=E,i=t[0],n=i[0],r=i[1],s=i[2],a=1/(e[3]*n+e[7]*r+e[11]*s+e[15]);this.x=this.X=(e[0]*n+e[4]*r+e[8]*s+e[12])*a,this.y=this.Y=(e[1]*n+e[5]*r+e[9]*s+e[13])*a;for(let i=1,n=t.length;i<n;++i){let n=t[i],r=n[0],s=n[1],a=n[2],o=1/(e[3]*r+e[7]*s+e[11]*a+e[15]),h=(e[0]*r+e[4]*s+e[8]*a+e[12])*o,l=(e[1]*r+e[5]*s+e[9]*a+e[13])*o;h<this.x?this.x=h:h>this.X&&(this.X=h),l<this.y?this.y=l:l>this.Y&&(this.Y=l)}return(this.X<-1.01||this.x>1.01||this.Y<-1.01||this.y>1.01)&&(this.Onscreen=!1,!0)}T(t){let e=this.c[0],i=this.c[1],n=this.c[2],r=t[0]-e,s=t[1]-i,a=t[2]-n;return[r*I[0]+s*I[3]+a*I[6]+e,r*I[1]+s*I[4]+a*I[7]+i,r*I[2]+s*I[5]+a*I[8]+n]}Tcorners(t,e){return[this.T(t),this.T([t[0],t[1],e[2]]),this.T([t[0],e[1],t[2]]),this.T([t[0],e[1],e[2]]),this.T([e[0],t[1],t[2]]),this.T([e[0],t[1],e[2]]),this.T([e[0],e[1],t[2]]),this.T(e)]}setMaterial(t,e){null==t.materialTable[this.MaterialIndex]&&(t.materials.length>=m&&(t.partial=!0,e()),t.materialTable[this.MaterialIndex]=t.materials.length,t.materials.push(c[this.MaterialIndex])),it=t.materialTable[this.MaterialIndex]}render(){let t;var e,i;if(this.setMaterialIndex(),0==this.CenterIndex?(e=this.Min,i=this.Max,t=[e,[e[0],e[1],i[2]],[e[0],i[1],e[2]],[e[0],i[1],i[2]],[i[0],e[1],e[2]],[i[0],e[1],i[2]],[i[0],i[1],e[2]],i]):(this.c=o.Centers[this.CenterIndex-1],t=this.Tcorners(this.Min,this.Max)),this.offscreen(t))return this.data.clear(),void this.notRendered();let n,r=this.controlpoints;if(0==this.CenterIndex){if(!U&&this.Onscreen)return void this.append();n=r}else{let t=r.length;n=Array(t);for(let e=0;e<t;++e)n[e]=this.T(r[e])}let s=o.orthographic?1:this.Min[2]/o.maxBound[2],a=.75*Math.hypot(s*(S.xmax-S.xmin),s*(S.ymax-S.ymin))/b;this.res2=a*a,this.Epsilon=.1*a,this.data.clear(),this.notRendered(),this.Onscreen=!0,this.process(n)}}function pt(t,e){let i=t[0],n=t.length;for(let r=1;r<n;++r)i=e(i,t[r]);return i}class vt extends ut{constructor(t,e,i,n,r,s){super(),this.controlpoints=t,this.CenterIndex=e,this.MaterialIndex=i,this.color=n;let a=t.length;if(n){let t=n[0][3]+n[1][3]+n[2][3];this.transparent=16==a||4==a?t+n[3][3]<1020:t<765}else this.transparent=c[i].diffuse[3]<1;this.vertex=this.transparent?this.data.Vertex.bind(this.data):this.data.vertex.bind(this.data);let o=this.L2norm2(this.controlpoints),h=Math.sqrt(1e3*Number.EPSILON*o);this.epsilon=o*Number.EPSILON,this.Min=r||this.Bounds(this.controlpoints,Math.min,h),this.Max=s||this.Bounds(this.controlpoints,Math.max,h)}setMaterialIndex(){this.transparent?this.setMaterial(tt,Ie):this.color?this.setMaterial(J,Ae):this.setMaterial(Q,ye)}cornerbound(t,e){let i=e(t[0],t[3]);return i=e(i,t[12]),e(i,t[15])}controlbound(t,e){let i=e(t[1],t[2]);return i=e(i,t[4]),i=e(i,t[5]),i=e(i,t[6]),i=e(i,t[7]),i=e(i,t[8]),i=e(i,t[9]),i=e(i,t[10]),i=e(i,t[11]),i=e(i,t[13]),e(i,t[14])}bound(t,e,i,n,r){if(i=e(i,this.cornerbound(t,e)),e(-1,1)*(i-this.controlbound(t,e))>=-n||0==r)return i;--r,n*=2;let s=new Nt(t[0],t[1],t[2],t[3]),a=new Nt(t[4],t[5],t[6],t[7]),o=new Nt(t[8],t[9],t[10],t[11]),h=new Nt(t[12],t[13],t[14],t[15]),l=new Nt(t[0],t[4],t[8],t[12]),c=new Nt(s.m0,a.m0,o.m0,h.m0),d=new Nt(s.m3,a.m3,o.m3,h.m3),m=new Nt(s.m5,a.m5,o.m5,h.m5),f=new Nt(s.m4,a.m4,o.m4,h.m4),u=new Nt(s.m2,a.m2,o.m2,h.m2),p=new Nt(t[3],t[7],t[11],t[15]),v=[t[0],s.m0,s.m3,s.m5,l.m0,c.m0,d.m0,m.m0,l.m3,c.m3,d.m3,m.m3,l.m5,c.m5,d.m5,m.m5];i=this.bound(v,e,i,n,r);let x=[l.m5,c.m5,d.m5,m.m5,l.m4,c.m4,d.m4,m.m4,l.m2,c.m2,d.m2,m.m2,t[12],h.m0,h.m3,h.m5];i=this.bound(x,e,i,n,r);let g=[m.m5,f.m5,u.m5,p.m5,m.m4,f.m4,u.m4,p.m4,m.m2,f.m2,u.m2,p.m2,h.m5,h.m4,h.m2,t[15]];i=this.bound(g,e,i,n,r);let w=[s.m5,s.m4,s.m2,t[3],m.m0,f.m0,u.m0,p.m0,m.m3,f.m3,u.m3,p.m3,m.m5,f.m5,u.m5,p.m5];return this.bound(w,e,i,n,r)}cornerboundtri(t,e){let i=e(t[0],t[6]);return e(i,t[9])}controlboundtri(t,e){let i=e(t[1],t[2]);return i=e(i,t[3]),i=e(i,t[4]),i=e(i,t[5]),i=e(i,t[7]),e(i,t[8])}boundtri(t,e,i,n,r){if(i=e(i,this.cornerboundtri(t,e)),e(-1,1)*(i-this.controlboundtri(t,e))>=-n||0==r)return i;--r,n*=2;let s=new _t(t),a=[s.l003,s.l102,s.l012,s.l201,s.l111,s.l021,s.l300,s.l210,s.l120,s.l030];i=this.boundtri(a,e,i,n,r);let o=[s.l300,s.r102,s.r012,s.r201,s.r111,s.r021,s.r300,s.r210,s.r120,s.r030];i=this.boundtri(o,e,i,n,r);let h=[s.l030,s.u102,s.u012,s.u201,s.u111,s.u021,s.r030,s.u210,s.u120,s.u030];i=this.boundtri(h,e,i,n,r);let l=[s.r030,s.u201,s.r021,s.u102,s.c111,s.r012,s.l030,s.l120,s.l210,s.l300];return this.boundtri(l,e,i,n,r)}Bounds(t,e,i){let n=Array(3),r=t.length,s=Array(r);for(let a=0;a<3;++a){for(let e=0;e<r;++e)s[e]=t[e][a];n[a]=16==r?this.bound(s,e,s[0],i,p):10==r?this.boundtri(s,e,s[0],i,p):pt(s,e)}return[n[0],n[1],n[2]]}L2norm2(t){let e=t[0],i=0,n=t.length;for(let r=1;r<n;++r)i=Math.max(i,St([t[r][0]-e[0],t[r][1]-e[1],t[r][2]-e[2]]));return i}processTriangle(t){let e=t[0],i=t[1],n=t[2],r=Pt(Vt([i[0]-e[0],i[1]-e[1],i[2]-e[2]],[n[0]-e[0],n[1]-e[1],n[2]-e[2]]));if(!this.offscreen([e,i,n])){let t,s,a;this.color?(t=this.data.Vertex(e,r,this.color[0]),s=this.data.Vertex(i,r,this.color[1]),a=this.data.Vertex(n,r,this.color[2])):(t=this.vertex(e,r),s=this.vertex(i,r),a=this.vertex(n,r)),0==V?(this.data.indices.push(t),this.data.indices.push(s),this.data.indices.push(a)):(this.data.indices.push(t),this.data.indices.push(s),this.data.indices.push(s),this.data.indices.push(a),this.data.indices.push(a),this.data.indices.push(t)),this.append()}}processQuad(t){let e=t[0],i=t[1],n=t[2],r=t[3],s=Vt([i[0]-e[0],i[1]-e[1],i[2]-e[2]],[n[0]-i[0],n[1]-i[1],n[2]-i[2]]),a=Vt([n[0]-r[0],n[1]-r[1],n[2]-r[2]],[r[0]-e[0],r[1]-e[1],r[2]-e[2]]),o=Pt([s[0]+a[0],s[1]+a[1],s[2]+a[2]]);if(!this.offscreen([e,i,n,r])){let t,s,a,h;this.color?(t=this.data.Vertex(e,o,this.color[0]),s=this.data.Vertex(i,o,this.color[1]),a=this.data.Vertex(n,o,this.color[2]),h=this.data.Vertex(r,o,this.color[3])):(t=this.vertex(e,o),s=this.vertex(i,o),a=this.vertex(n,o),h=this.vertex(r,o)),0==V?(this.data.indices.push(t),this.data.indices.push(s),this.data.indices.push(a),this.data.indices.push(t),this.data.indices.push(a),this.data.indices.push(h)):(this.data.indices.push(t),this.data.indices.push(s),this.data.indices.push(s),this.data.indices.push(a),this.data.indices.push(a),this.data.indices.push(h),this.data.indices.push(h),this.data.indices.push(t)),this.append()}}curve(t,e,i,n,r){new wt([t[e],t[i],t[n],t[r]],0,it,this.Min,this.Max).render()}process(t){if(this.transparent&&1!=V&&(it=this.color?-1-it:1+it),10==t.length)return this.process3(t);if(3==t.length)return this.processTriangle(t);if(4==t.length)return this.processQuad(t);if(1==V)return this.curve(t,0,4,8,12),this.curve(t,12,13,14,15),this.curve(t,15,11,7,3),void this.curve(t,3,2,1,0);let e=t[0],i=t[3],n=t[12],r=t[15],s=this.normal(i,t[2],t[1],e,t[4],t[8],n);St(s)<this.epsilon&&(s=this.normal(i,t[2],t[1],e,t[13],t[14],r),St(s)<this.epsilon&&(s=this.normal(r,t[11],t[7],i,t[4],t[8],n)));let a=this.normal(e,t[4],t[8],n,t[13],t[14],r);St(a)<this.epsilon&&(a=this.normal(e,t[4],t[8],n,t[11],t[7],i),St(a)<this.epsilon&&(a=this.normal(i,t[2],t[1],e,t[13],t[14],r)));let o=this.normal(n,t[13],t[14],r,t[11],t[7],i);St(o)<this.epsilon&&(o=this.normal(n,t[13],t[14],r,t[2],t[1],e),St(o)<this.epsilon&&(o=this.normal(e,t[4],t[8],n,t[11],t[7],i)));let h=this.normal(r,t[11],t[7],i,t[2],t[1],e);if(St(h)<this.epsilon&&(h=this.normal(r,t[11],t[7],i,t[4],t[8],n),St(h)<this.epsilon&&(h=this.normal(n,t[13],t[14],r,t[2],t[1],e))),this.color){let l=this.color[0],c=this.color[1],d=this.color[2],m=this.color[3],f=this.data.Vertex(e,s,l),u=this.data.Vertex(n,a,c),p=this.data.Vertex(r,o,d),v=this.data.Vertex(i,h,m);this.Render(t,f,u,p,v,e,n,r,i,!1,!1,!1,!1,l,c,d,m)}else{let l=this.vertex(e,s),c=this.vertex(n,a),d=this.vertex(r,o),m=this.vertex(i,h);this.Render(t,l,c,d,m,e,n,r,i,!1,!1,!1,!1)}this.data.indices.length>0&&this.append()}append(){this.transparent?tt.append(this.data):this.color?J.append(this.data):Q.append(this.data)}notRendered(){this.transparent?tt.rendered=!1:this.color?J.rendered=!1:Q.rendered=!1}Render(t,e,i,n,r,s,a,o,h,l,c,d,m,f,u,p,v){let x=this.Distance(t);if(x[0]<this.res2&&x[1]<this.res2)this.offscreen([s,a,o])||(0==V?(this.data.indices.push(e),this.data.indices.push(i),this.data.indices.push(n)):(this.data.indices.push(e),this.data.indices.push(i),this.data.indices.push(i),this.data.indices.push(n))),this.offscreen([s,o,h])||(0==V?(this.data.indices.push(e),this.data.indices.push(n),this.data.indices.push(r)):(this.data.indices.push(n),this.data.indices.push(r),this.data.indices.push(r),this.data.indices.push(e)));else{if(this.offscreen(t))return;let g=t[0],w=t[3],M=t[12],b=t[15];if(x[0]<this.res2){let x=new Ot(g,t[1],t[2],w),R=new Ot(t[4],t[5],t[6],t[7]),T=new Ot(t[8],t[9],t[10],t[11]),y=new Ot(M,t[13],t[14],b),A=[g,x.m0,x.m3,x.m5,t[4],R.m0,R.m3,R.m5,t[8],T.m0,T.m3,T.m5,M,y.m0,y.m3,y.m5],E=[x.m5,x.m4,x.m2,w,R.m5,R.m4,R.m2,t[7],T.m5,T.m4,T.m2,t[11],y.m5,y.m4,y.m2,b],I=this.normal(A[12],A[13],A[14],A[15],A[11],A[7],A[3]);St(I)<=this.epsilon&&(I=this.normal(A[12],A[13],A[14],A[15],A[2],A[1],A[0]),St(I)<=this.epsilon&&(I=this.normal(A[0],A[4],A[8],A[12],A[11],A[7],A[3])));let L=this.normal(E[3],E[2],E[1],E[0],E[4],E[8],E[12]);St(L)<=this.epsilon&&(L=this.normal(E[3],E[2],E[1],E[0],E[13],E[14],E[15]),St(L)<=this.epsilon&&(L=this.normal(E[15],E[11],E[7],E[3],E[4],E[8],E[12])));let N=this.Epsilon,O=[.5*(a[0]+o[0]),.5*(a[1]+o[1]),.5*(a[2]+o[2])];if(!c)if(c=zt(M,t[13],t[14],b)<this.res2){let t=Pt(this.differential(E[12],E[8],E[4],E[0]));O=[O[0]-N*t[0],O[1]-N*t[1],O[2]-N*t[2]]}else O=A[15];let _=[.5*(h[0]+s[0]),.5*(h[1]+s[1]),.5*(h[2]+s[2])];if(!m)if(m=zt(g,t[1],t[2],w)<this.res2){let t=Pt(this.differential(A[3],A[7],A[11],A[15]));_=[_[0]-N*t[0],_[1]-N*t[1],_[2]-N*t[2]]}else _=E[0];if(f){let t=Array(4),x=Array(4);for(let e=0;e<4;++e)t[e]=.5*(u[e]+p[e]),x[e]=.5*(v[e]+f[e]);let g=this.data.Vertex(O,I,t),w=this.data.Vertex(_,L,x);this.Render(A,e,i,g,w,s,a,O,_,l,c,!1,m,f,u,t,x),this.Render(E,w,g,n,r,_,O,o,h,!1,c,d,m,x,t,p,v)}else{let t=this.vertex(O,I),f=this.vertex(_,L);this.Render(A,e,i,t,f,s,a,O,_,l,c,!1,m),this.Render(E,f,t,n,r,_,O,o,h,!1,c,d,m)}return}if(x[1]<this.res2){let x=new Ot(g,t[4],t[8],M),R=new Ot(t[1],t[5],t[9],t[13]),T=new Ot(t[2],t[6],t[10],t[14]),y=new Ot(w,t[7],t[11],b),A=[g,t[1],t[2],w,x.m0,R.m0,T.m0,y.m0,x.m3,R.m3,T.m3,y.m3,x.m5,R.m5,T.m5,y.m5],E=[x.m5,R.m5,T.m5,y.m5,x.m4,R.m4,T.m4,y.m4,x.m2,R.m2,T.m2,y.m2,M,t[13],t[14],b],I=this.normal(A[0],A[4],A[8],A[12],A[13],A[14],A[15]);St(I)<=this.epsilon&&(I=this.normal(A[0],A[4],A[8],A[12],A[11],A[7],A[3]),St(I)<=this.epsilon&&(I=this.normal(A[3],A[2],A[1],A[0],A[13],A[14],A[15])));let L=this.normal(E[15],E[11],E[7],E[3],E[2],E[1],E[0]);St(L)<=this.epsilon&&(L=this.normal(E[15],E[11],E[7],E[3],E[4],E[8],E[12]),St(L)<=this.epsilon&&(L=this.normal(E[12],E[13],E[14],E[15],E[2],E[1],E[0])));let N=this.Epsilon,O=[.5*(s[0]+a[0]),.5*(s[1]+a[1]),.5*(s[2]+a[2])];if(!l)if(l=zt(g,t[4],t[8],M)<this.res2){let t=Pt(this.differential(E[0],E[1],E[2],E[3]));O=[O[0]-N*t[0],O[1]-N*t[1],O[2]-N*t[2]]}else O=A[12];let _=[.5*(o[0]+h[0]),.5*(o[1]+h[1]),.5*(o[2]+h[2])];if(!d)if(d=zt(b,t[11],t[7],w)<this.res2){let t=Pt(this.differential(A[15],A[14],A[13],A[12]));_=[_[0]-N*t[0],_[1]-N*t[1],_[2]-N*t[2]]}else _=E[3];if(f){let t=Array(4),x=Array(4);for(let e=0;e<4;++e)t[e]=.5*(f[e]+u[e]),x[e]=.5*(p[e]+v[e]);let g=this.data.Vertex(O,I,t),w=this.data.Vertex(_,L,x);this.Render(A,e,g,w,r,s,O,_,h,l,!1,d,m,f,t,x,v),this.Render(E,g,i,n,w,O,a,o,_,l,c,d,!1,t,u,p,x)}else{let t=this.vertex(O,I),f=this.vertex(_,L);this.Render(A,e,t,f,r,s,O,_,h,l,!1,d,m),this.Render(E,t,i,n,f,O,a,o,_,l,c,d,!1)}return}let R=new Ot(g,t[1],t[2],w),T=new Ot(t[4],t[5],t[6],t[7]),y=new Ot(t[8],t[9],t[10],t[11]),A=new Ot(M,t[13],t[14],b),E=new Ot(g,t[4],t[8],M),I=new Ot(R.m0,T.m0,y.m0,A.m0),L=new Ot(R.m3,T.m3,y.m3,A.m3),N=new Ot(R.m5,T.m5,y.m5,A.m5),O=new Ot(R.m4,T.m4,y.m4,A.m4),_=new Ot(R.m2,T.m2,y.m2,A.m2),P=new Ot(w,t[7],t[11],b),S=[g,R.m0,R.m3,R.m5,E.m0,I.m0,L.m0,N.m0,E.m3,I.m3,L.m3,N.m3,E.m5,I.m5,L.m5,N.m5],U=[E.m5,I.m5,L.m5,N.m5,E.m4,I.m4,L.m4,N.m4,E.m2,I.m2,L.m2,N.m2,M,A.m0,A.m3,A.m5],V=[N.m5,O.m5,_.m5,P.m5,N.m4,O.m4,_.m4,P.m4,N.m2,O.m2,_.m2,P.m2,A.m5,A.m4,A.m2,b],B=[R.m5,R.m4,R.m2,w,N.m0,O.m0,_.m0,P.m0,N.m3,O.m3,_.m3,P.m3,N.m5,O.m5,_.m5,P.m5],D=S[15],C=this.normal(S[0],S[4],S[8],S[12],S[13],S[14],S[15]);St(C)<this.epsilon&&(C=this.normal(S[0],S[4],S[8],S[12],S[11],S[7],S[3]),St(C)<this.epsilon&&(C=this.normal(S[3],S[2],S[1],S[0],S[13],S[14],S[15])));let F=this.normal(U[12],U[13],U[14],U[15],U[11],U[7],U[3]);St(F)<this.epsilon&&(F=this.normal(U[12],U[13],U[14],U[15],U[2],U[1],U[0]),St(F)<this.epsilon&&(F=this.normal(U[0],U[4],U[8],U[12],U[11],U[7],U[3])));let z=this.normal(V[15],V[11],V[7],V[3],V[2],V[1],V[0]);St(z)<this.epsilon&&(z=this.normal(V[15],V[11],V[7],V[3],V[4],V[8],V[12]),St(z)<this.epsilon&&(z=this.normal(V[12],V[13],V[14],V[15],V[2],V[1],V[0])));let H=this.normal(B[3],B[2],B[1],B[0],B[4],B[8],B[12]);St(H)<this.epsilon&&(H=this.normal(B[3],B[2],B[1],B[0],B[13],B[14],B[15]),St(H)<this.epsilon&&(H=this.normal(B[15],B[11],B[7],B[3],B[4],B[8],B[12])));let X=this.normal(V[3],V[2],V[1],D,V[4],V[8],V[12]),G=this.Epsilon,W=[.5*(s[0]+a[0]),.5*(s[1]+a[1]),.5*(s[2]+a[2])];if(!l)if(l=zt(g,t[4],t[8],M)<this.res2){let t=Pt(this.differential(U[0],U[1],U[2],U[3]));W=[W[0]-G*t[0],W[1]-G*t[1],W[2]-G*t[2]]}else W=S[12];let j=[.5*(a[0]+o[0]),.5*(a[1]+o[1]),.5*(a[2]+o[2])];if(!c)if(c=zt(M,t[13],t[14],b)<this.res2){let t=Pt(this.differential(V[12],V[8],V[4],V[0]));j=[j[0]-G*t[0],j[1]-G*t[1],j[2]-G*t[2]]}else j=U[15];let k=[.5*(o[0]+h[0]),.5*(o[1]+h[1]),.5*(o[2]+h[2])];if(!d)if(d=zt(b,t[11],t[7],w)<this.res2){let t=Pt(this.differential(B[15],B[14],B[13],B[12]));k=[k[0]-G*t[0],k[1]-G*t[1],k[2]-G*t[2]]}else k=V[3];let Y=[.5*(h[0]+s[0]),.5*(h[1]+s[1]),.5*(h[2]+s[2])];if(!m)if(m=zt(g,t[1],t[2],w)<this.res2){let t=Pt(this.differential(S[3],S[7],S[11],S[15]));Y=[Y[0]-G*t[0],Y[1]-G*t[1],Y[2]-G*t[2]]}else Y=B[0];if(f){let t=Array(4),x=Array(4),g=Array(4),w=Array(4),M=Array(4);for(let e=0;e<4;++e)t[e]=.5*(f[e]+u[e]),x[e]=.5*(u[e]+p[e]),g[e]=.5*(p[e]+v[e]),w[e]=.5*(v[e]+f[e]),M[e]=.5*(t[e]+g[e]);let b=this.data.Vertex(W,C,t),R=this.data.Vertex(j,F,x),T=this.data.Vertex(k,z,g),y=this.data.Vertex(Y,H,w),A=this.data.Vertex(D,X,M);this.Render(S,e,b,A,y,s,W,D,Y,l,!1,!1,m,f,t,M,w),this.Render(U,b,i,R,A,W,a,j,D,l,c,!1,!1,t,u,x,M),this.Render(V,A,R,n,T,D,j,o,k,!1,c,d,!1,M,x,p,g),this.Render(B,y,A,T,r,Y,D,k,h,!1,!1,d,m,w,M,g,v)}else{let t=this.vertex(W,C),f=this.vertex(j,F),u=this.vertex(k,z),p=this.vertex(Y,H),v=this.vertex(D,X);this.Render(S,e,t,v,p,s,W,D,Y,l,!1,!1,m),this.Render(U,t,i,f,v,W,a,j,D,l,c,!1,!1),this.Render(V,v,f,n,u,D,j,o,k,!1,c,d,!1),this.Render(B,p,v,u,r,Y,D,k,h,!1,!1,d,m)}}}process3(t){if(1==V)return this.curve(t,0,1,3,6),this.curve(t,6,7,8,9),void this.curve(t,9,5,2,0);let e=t[0],i=t[6],n=t[9],r=this.normal(n,t[5],t[2],e,t[1],t[3],i),s=this.normal(e,t[1],t[3],i,t[7],t[8],n),a=this.normal(i,t[7],t[8],n,t[5],t[2],e);if(this.color){let o=this.color[0],h=this.color[1],l=this.color[2],c=this.data.Vertex(e,r,o),d=this.data.Vertex(i,s,h),m=this.data.Vertex(n,a,l);this.Render3(t,c,d,m,e,i,n,!1,!1,!1,o,h,l)}else{let o=this.vertex(e,r),h=this.vertex(i,s),l=this.vertex(n,a);this.Render3(t,o,h,l,e,i,n,!1,!1,!1)}this.data.indices.length>0&&this.append()}Render3(t,e,i,n,r,s,a,o,h,l,c,d,m){if(this.Distance3(t)<this.res2)this.offscreen([r,s,a])||(0==V?(this.data.indices.push(e),this.data.indices.push(i),this.data.indices.push(n)):(this.data.indices.push(e),this.data.indices.push(i),this.data.indices.push(i),this.data.indices.push(n),this.data.indices.push(n),this.data.indices.push(e)));else{if(this.offscreen(t))return;let f=t[0],u=t[1],p=t[2],v=t[3],x=t[4],g=t[5],w=t[6],M=t[7],b=t[8],R=t[9],T=[.5*(R[0]+g[0]),.5*(R[1]+g[1]),.5*(R[2]+g[2])],y=[.5*(R[0]+b[0]),.5*(R[1]+b[1]),.5*(R[2]+b[2])],A=[.5*(g[0]+p[0]),.5*(g[1]+p[1]),.5*(g[2]+p[2])],E=[.5*(b[0]+x[0]),.5*(b[1]+x[1]),.5*(b[2]+x[2])],I=[.5*(b[0]+M[0]),.5*(b[1]+M[1]),.5*(b[2]+M[2])],L=[.5*(p[0]+x[0]),.5*(p[1]+x[1]),.5*(p[2]+x[2])],N=[.5*(p[0]+f[0]),.5*(p[1]+f[1]),.5*(p[2]+f[2])],O=[.5*(x[0]+v[0]),.5*(x[1]+v[1]),.5*(x[2]+v[2])],_=[.5*(M[0]+w[0]),.5*(M[1]+w[1]),.5*(M[2]+w[2])],P=[.5*(f[0]+u[0]),.5*(f[1]+u[1]),.5*(f[2]+u[2])],S=[.5*(u[0]+v[0]),.5*(u[1]+v[1]),.5*(u[2]+v[2])],U=[.5*(v[0]+w[0]),.5*(v[1]+w[1]),.5*(v[2]+w[2])],V=[.5*(T[0]+A[0]),.5*(T[1]+A[1]),.5*(T[2]+A[2])],B=[.5*(y[0]+I[0]),.5*(y[1]+I[1]),.5*(y[2]+I[2])],D=[.5*(A[0]+N[0]),.5*(A[1]+N[1]),.5*(A[2]+N[2])],C=[.5*E[0]+.25*(x[0]+u[0]),.5*E[1]+.25*(x[1]+u[1]),.5*E[2]+.25*(x[2]+u[2])],F=[.5*(I[0]+_[0]),.5*(I[1]+_[1]),.5*(I[2]+_[2])],z=[.5*L[0]+.25*(x[0]+M[0]),.5*L[1]+.25*(x[1]+M[1]),.5*L[2]+.25*(x[2]+M[2])],H=[.25*(g[0]+x[0])+.5*O[0],.25*(g[1]+x[1])+.5*O[1],.25*(g[2]+x[2])+.5*O[2]],X=[.5*(P[0]+S[0]),.5*(P[1]+S[1]),.5*(P[2]+S[2])],G=[.5*(S[0]+U[0]),.5*(S[1]+U[1]),.5*(S[2]+U[2])],W=[.5*(z[0]+X[0]),.5*(z[1]+X[1]),.5*(z[2]+X[2])],j=[.5*(z[0]+G[0]),.5*(z[1]+G[1]),.5*(z[2]+G[2])],k=[.5*(X[0]+G[0]),.5*(X[1]+G[1]),.5*(X[2]+G[2])],Y=[.5*(H[0]+F[0]),.5*(H[1]+F[1]),.5*(H[2]+F[2])],$=[.5*(B[0]+H[0]),.5*(B[1]+H[1]),.5*(B[2]+H[2])],q=[.5*(B[0]+F[0]),.5*(B[1]+F[1]),.5*(B[2]+F[2])],K=[.5*(V[0]+C[0]),.5*(V[1]+C[1]),.5*(V[2]+C[2])],Z=[.5*(D[0]+C[0]),.5*(D[1]+C[1]),.5*(D[2]+C[2])],Q=[.5*(V[0]+D[0]),.5*(V[1]+D[1]),.5*(V[2]+D[2])],J=[f,P,N,X,[.5*(L[0]+P[0]),.5*(L[1]+P[1]),.5*(L[2]+P[2])],D,k,W,Z,Q],tt=[k,G,j,U,[.5*(O[0]+_[0]),.5*(O[1]+_[1]),.5*(O[2]+_[2])],Y,w,_,F,q],et=[Q,K,V,$,[.5*(T[0]+E[0]),.5*(T[1]+E[1]),.5*(T[2]+E[2])],T,q,B,y,R],it=[q,$,Y,K,[.25*(A[0]+I[0]+S[0]+x[0]),.25*(A[1]+I[1]+S[1]+x[1]),.25*(A[2]+I[2]+S[2]+x[2])],j,Q,Z,W,k],nt=this.normal(k,j,Y,q,$,K,Q),rt=this.normal(q,$,K,Q,Z,W,k),st=this.normal(Q,Z,W,k,j,Y,q),at=this.Epsilon,ot=[.5*(s[0]+a[0]),.5*(s[1]+a[1]),.5*(s[2]+a[2])];if(!o)if(o=zt(w,M,b,R)<this.res2){let t=Pt(this.sumdifferential(it[0],it[2],it[5],it[9],it[1],it[3],it[6]));ot=[ot[0]-at*t[0],ot[1]-at*t[1],ot[2]-at*t[2]]}else ot=q;let ht=[.5*(a[0]+r[0]),.5*(a[1]+r[1]),.5*(a[2]+r[2])];if(!h)if(h=zt(f,p,g,R)<this.res2){let t=Pt(this.sumdifferential(it[6],it[3],it[1],it[0],it[7],it[8],it[9]));ht=[ht[0]-at*t[0],ht[1]-at*t[1],ht[2]-at*t[2]]}else ht=Q;let lt=[.5*(r[0]+s[0]),.5*(r[1]+s[1]),.5*(r[2]+s[2])];if(!l)if(l=zt(f,u,v,w)<this.res2){let t=Pt(this.sumdifferential(it[9],it[8],it[7],it[6],it[5],it[2],it[0]));lt=[lt[0]-at*t[0],lt[1]-at*t[1],lt[2]-at*t[2]]}else lt=k;if(c){let t=Array(4),f=Array(4),u=Array(4);for(let e=0;e<4;++e)t[e]=.5*(d[e]+m[e]),f[e]=.5*(m[e]+c[e]),u[e]=.5*(c[e]+d[e]);let p=this.data.Vertex(ot,nt,t),v=this.data.Vertex(ht,rt,f),x=this.data.Vertex(lt,st,u);this.Render3(J,e,x,v,r,lt,ht,!1,h,l,c,u,f),this.Render3(tt,x,i,p,lt,s,ot,o,!1,l,u,d,t),this.Render3(et,v,p,n,ht,ot,a,o,h,!1,f,t,m),this.Render3(it,p,v,x,ot,ht,lt,!1,!1,!1,t,f,u)}else{let t=this.vertex(ot,nt),c=this.vertex(ht,rt),d=this.vertex(lt,st);this.Render3(J,e,d,c,r,lt,ht,!1,h,l),this.Render3(tt,d,i,t,lt,s,ot,o,!1,l),this.Render3(et,c,t,n,ht,ot,a,o,h,!1),this.Render3(it,t,c,d,ot,ht,lt,!1,!1,!1)}}}Distance(t){let e=t[0],i=t[3],n=t[12],r=t[15],s=Ht(e,n,i,r);s=Math.max(zt(e,t[4],t[8],n)),s=Math.max(s,zt(t[1],t[5],t[9],t[13])),s=Math.max(s,zt(i,t[7],t[11],r)),s=Math.max(s,zt(t[2],t[6],t[10],t[14]));let a=Ht(e,i,n,r);return a=Math.max(a,zt(e,t[1],t[2],i)),a=Math.max(a,zt(t[4],t[5],t[6],t[7])),a=Math.max(a,zt(t[8],t[9],t[10],t[11])),a=Math.max(a,zt(n,t[13],t[14],r)),[s,a]}Distance3(t){let e=t[0],i=t[4],n=t[6],r=t[9],s=St([(e[0]+n[0]+r[0])*(1/3)-i[0],(e[1]+n[1]+r[1])*(1/3)-i[1],(e[2]+n[2]+r[2])*(1/3)-i[2]]);return s=Math.max(s,zt(e,t[1],t[3],n)),s=Math.max(s,zt(e,t[2],t[5],r)),Math.max(s,zt(n,t[7],t[8],r))}differential(t,e,i,n){let r=[3*(e[0]-t[0]),3*(e[1]-t[1]),3*(e[2]-t[2])];return St(r)>this.epsilon?r:(r=Ct(t,e,i),St(r)>this.epsilon?r:Ft(t,e,i,n))}sumdifferential(t,e,i,n,r,s,a){let o=this.differential(t,e,i,n),h=this.differential(t,r,s,a);return[o[0]+h[0],o[1]+h[1],o[2]+h[2]]}normal(t,e,i,n,r,s,a){let o=3*(r[0]-n[0]),h=3*(r[1]-n[1]),l=3*(r[2]-n[2]),c=3*(i[0]-n[0]),d=3*(i[1]-n[1]),m=3*(i[2]-n[2]),f=[h*m-l*d,l*c-o*m,o*d-h*c];if(St(f)>this.epsilon)return f;let u=[c,d,m],p=[o,h,l],v=Ct(n,i,e),x=Ct(n,r,s),g=Vt(x,u),w=Vt(p,v);if(f=[g[0]+w[0],g[1]+w[1],g[2]+w[2]],St(f)>this.epsilon)return f;let M=Ft(n,i,e,t),b=Ft(n,r,s,a);g=Vt(p,M),w=Vt(b,u);let R=Vt(x,v);return f=[g[0]+w[0]+R[0],g[1]+w[1]+R[1],g[2]+w[2]+R[2]],St(f)>this.epsilon?f:(g=Vt(b,v),w=Vt(x,M),f=[g[0]+w[0],g[1]+w[1],g[2]+w[2]],St(f)>this.epsilon?f:Vt(b,M))}}function xt(t){return 0<=t&&t<=1}class gt{constructor(t,e,i){const n=1e3*Number.EPSILON,r=n*n;if(Math.abs(t)<=n*Math.abs(e)+r*Math.abs(i))Math.abs(e)>n*Math.abs(i)?(this.roots=1,this.t1=-i/e):0==i?(this.roots=1,this.t1=0):this.roots=0;else{let r=.5*e/t,s=e*r;if(Math.abs(s)<=n*Math.abs(i)){let e=-i/t;e>=0?(this.roots=2,this.t2=Math.sqrt(e),this.t1=-this.t2):this.roots=0}else{let t=-2*i/s;if(t>-1){this.roots=2;let e=r*function(t){return t/(Math.sqrt(1+t)+1)}(t),i=-e-2*r;i<=e?(this.t1=i,this.t2=e):(this.t1=e,this.t2=i)}else-1==t?(this.roots=1,this.t1=this.t2=-r):this.roots=0}}}}class wt extends ut{constructor(t,e,i,n,r){if(super(),this.controlpoints=t,this.CenterIndex=e,this.MaterialIndex=i,n&&r)this.Min=n,this.Max=r;else{let t=this.Bounds(this.controlpoints);this.Min=t[0],this.Max=t[1]}}Bounds(t){let e=Array(3),i=Array(3),n=t.length,r=Array(n);for(let h=0;h<3;++h){for(let e=0;e<n;++e)r[e]=t[e][h];let l,c;if(l=c=r[0],4==n){l=Math.min(l,r[3]),c=Math.max(c,r[3]);let t=(s=r[0],a=r[1],o=r[2],[r[3]-s+3*(a-o),2*(s+o)-4*a,a-s]),e=new gt(t[0],t[1],t[2]);if(0!=e.roots&&xt(e.t1)){let t=Bt(r[0],r[1],r[2],r[3],e.t1);l=Math.min(l,t),c=Math.max(c,t)}if(2==e.roots&&xt(e.t2)){let t=Bt(r[0],r[1],r[2],r[3],e.t2);l=Math.min(l,t),c=Math.max(c,t)}}else{let t=r[1];l=Math.min(l,t),c=Math.max(c,t)}e[h]=l,i[h]=c}var s,a,o;return[[e[0],e[1],e[2]],[i[0],i[1],i[2]]]}setMaterialIndex(){this.setMaterial(Z,Te)}processLine(t){let e=t[0],i=t[1];if(!this.offscreen([e,i])){let t=[0,0,1];this.data.indices.push(this.data.vertex(e,t)),this.data.indices.push(this.data.vertex(i,t)),this.append()}}process(t){if(2==t.length)return this.processLine(t);let e=t[0],i=t[1],n=t[2],r=t[3],s=this.normal(Dt(e,i),Ct(e,i,n)),a=this.normal(Dt(n,r),Ct(r,n,i)),o=this.data.vertex(e,s),h=this.data.vertex(r,a);this.Render(t,o,h),this.data.indices.length>0&&this.append()}append(){Z.append(this.data)}notRendered(){Z.rendered=!1}Render(t,e,i){let n=t[0],r=t[1],s=t[2],a=t[3];if(zt(n,r,s,a)<this.res2)this.offscreen([n,a])||(this.data.indices.push(e),this.data.indices.push(i));else{if(this.offscreen(t))return;let o=[.5*(n[0]+r[0]),.5*(n[1]+r[1]),.5*(n[2]+r[2])],h=[.5*(r[0]+s[0]),.5*(r[1]+s[1]),.5*(r[2]+s[2])],l=[.5*(s[0]+a[0]),.5*(s[1]+a[1]),.5*(s[2]+a[2])],c=[.5*(o[0]+h[0]),.5*(o[1]+h[1]),.5*(o[2]+h[2])],d=[.5*(h[0]+l[0]),.5*(h[1]+l[1]),.5*(h[2]+l[2])],m=[.5*(c[0]+d[0]),.5*(c[1]+d[1]),.5*(c[2]+d[2])],f=[n,o,c,m],u=[m,d,l,a],p=this.normal(function(t,e,i,n){return[i[0]+n[0]-t[0]-e[0],i[1]+n[1]-t[1]-e[1],i[2]+n[2]-t[2]-e[2]]}(n,r,s,a),function(t,e,i,n){return[3*t[0]-5*e[0]+i[0]+n[0],3*t[1]-5*e[1]+i[1]+n[1],3*t[2]-5*e[2]+i[2]+n[2]]}(n,r,s,a)),v=this.data.vertex(m,p);this.Render(f,e,v),this.Render(u,v,i)}}normal(t,e){let i=Ut(t,t),n=Ut(t,e);return[i*e[0]-n*t[0],i*e[1]-n*t[1],i*e[2]-n*t[2]]}}class Mt extends ut{constructor(t,e,i){super(),this.controlpoint=t,this.width=e,this.CenterIndex=0,this.MaterialIndex=i,this.Min=t,this.Max=t}setMaterialIndex(){this.setMaterial(K,Re)}process(t){this.data.indices.push(this.data.vertex0(this.controlpoint,this.width)),this.append()}append(){K.append(this.data)}notRendered(){K.rendered=!1}}class bt extends ut{constructor(t,e){super(),this.CenterIndex=t,this.MaterialIndex=e,this.Min=this.Bounds(F,Math.min),this.Max=this.Bounds(F,Math.max),this.controlpoints=F,this.Normals=z,this.Colors=H,this.Indices=X,F=[],z=[],H=[],X=[],this.transparent=c[this.MaterialIndex].diffuse[3]<1}Bounds(t,e){let i=Array(3),n=t.length,r=Array(n);for(let s=0;s<3;++s){for(let e=0;e<n;++e)r[e]=t[e][s];i[s]=pt(r,e)}return[i[0],i[1],i[2]]}setMaterialIndex(){this.transparent?this.setMaterial(tt,Ie):this.setMaterial(et,Ee)}process(t){this.data.vertices=new Array(6*t.length),it=this.Colors.length>0?-1-it:1+it;for(let e=0,i=this.Indices.length;e<i;++e){let i=this.Indices[e],n=i[0],r=t[n[0]],s=t[n[1]],a=t[n[2]];if(!this.offscreen([r,s,a])){let t=i.length>1?i[1]:n;if(t&&0!=t.length||(t=n),this.Colors.length>0){let e=i.length>2?i[2]:n;e&&0!=e.length||(e=n);let o=this.Colors[e[0]],h=this.Colors[e[1]],l=this.Colors[e[2]];this.transparent|=o[3]+h[3]+l[3]<765,0==V?(this.data.iVertex(n[0],r,this.Normals[t[0]],o),this.data.iVertex(n[1],s,this.Normals[t[1]],h),this.data.iVertex(n[2],a,this.Normals[t[2]],l)):(this.data.iVertex(n[0],r,this.Normals[t[0]],o),this.data.iVertex(n[1],s,this.Normals[t[1]],h),this.data.iVertex(n[1],s,this.Normals[t[1]],h),this.data.iVertex(n[2],a,this.Normals[t[2]],l),this.data.iVertex(n[2],a,this.Normals[t[2]],l),this.data.iVertex(n[0],r,this.Normals[t[0]],o))}else 0==V?(this.data.iVertex(n[0],r,this.Normals[t[0]]),this.data.iVertex(n[1],s,this.Normals[t[1]]),this.data.iVertex(n[2],a,this.Normals[t[2]])):(this.data.iVertex(n[0],r,this.Normals[t[0]]),this.data.iVertex(n[1],s,this.Normals[t[1]]),this.data.iVertex(n[1],s,this.Normals[t[1]]),this.data.iVertex(n[2],a,this.Normals[t[2]]),this.data.iVertex(n[2],a,this.Normals[t[2]]),this.data.iVertex(n[0],r,this.Normals[t[0]]))}}this.data.nvertices=t.length,this.data.indices.length>0&&this.append()}append(){this.transparent?tt.append(this.data):et.append(this.data)}notRendered(){this.transparent?tt.rendered=!1:et.rendered=!1}}function Rt(){M=-Math.tan(.5*o.angleOfView)*o.maxBound[2],_.x=_.y=0,_.z=.5*(o.minBound[2]+o.maxBound[2]),x=v=o.zoom0,S.zmin=o.minBound[2],S.zmax=o.maxBound[2],P.x=P.y=0,Oe(),U=!0,Ne()}let Tt=0,yt=1,At=2,Et=3,It=4;function Lt(e=[]){let i=lt(t,vertex,t.VERTEX_SHADER,e),n=lt(t,fragment,t.FRAGMENT_SHADER,e),r=t.createProgram();return t.attachShader(r,i),t.attachShader(r,n),t.bindAttribLocation(r,Tt,"position"),t.bindAttribLocation(r,yt,"normal"),t.bindAttribLocation(r,At,"materialIndex"),t.bindAttribLocation(r,Et,"color"),t.bindAttribLocation(r,It,"width"),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)||alert("Could not initialize shaders"),r}class Nt{constructor(t,e,i,n){this.m0=.5*(t+e);let r=.5*(e+i);this.m2=.5*(i+n),this.m3=.5*(this.m0+r),this.m4=.5*(r+this.m2),this.m5=.5*(this.m3+this.m4)}}class Ot{constructor(t,e,i,n){this.m0=[.5*(t[0]+e[0]),.5*(t[1]+e[1]),.5*(t[2]+e[2])];let r=.5*(e[0]+i[0]),s=.5*(e[1]+i[1]),a=.5*(e[2]+i[2]);this.m2=[.5*(i[0]+n[0]),.5*(i[1]+n[1]),.5*(i[2]+n[2])],this.m3=[.5*(this.m0[0]+r),.5*(this.m0[1]+s),.5*(this.m0[2]+a)],this.m4=[.5*(r+this.m2[0]),.5*(s+this.m2[1]),.5*(a+this.m2[2])],this.m5=[.5*(this.m3[0]+this.m4[0]),.5*(this.m3[1]+this.m4[1]),.5*(this.m3[2]+this.m4[2])]}}class _t{constructor(t){this.l003=t[0];let e=t[1],i=t[2],n=t[3],r=t[4],s=t[5];this.r300=t[6];let a=t[7],o=t[8];this.u030=t[9],this.u021=.5*(this.u030+s),this.u120=.5*(this.u030+o);let h=.5*(s+i),l=.5*(o+r),c=.5*(o+a),d=.5*(i+r);this.l012=.5*(i+this.l003);let m=.5*(r+n);this.r210=.5*(a+this.r300),this.l102=.5*(this.l003+e);let f=.5*(e+n);this.r201=.5*(n+this.r300),this.u012=.5*(this.u021+h),this.u210=.5*(this.u120+c),this.l021=.5*(h+this.l012);let u=.5*l+.25*(r+e);this.r120=.5*(c+this.r210);let p=.5*d+.25*(r+a),v=.25*(s+r)+.5*m;this.l201=.5*(this.l102+f),this.r102=.5*(f+this.r201),this.l210=.5*(p+this.l201),this.r012=.5*(p+this.r102),this.l300=.5*(this.l201+this.r102),this.r021=.5*(v+this.r120),this.u201=.5*(this.u210+v),this.r030=.5*(this.u210+this.r120),this.u102=.5*(this.u012+u),this.l120=.5*(this.l021+u),this.l030=.5*(this.u012+this.l021),this.l111=.5*(d+this.l102),this.r111=.5*(m+this.r210),this.u111=.5*(this.u021+l),this.c111=.25*(h+c+f+r)}}function Pt(t){let e=1/(Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])||1);return[t[0]*e,t[1]*e,t[2]*e]}function St(t){return t[0]*t[0]+t[1]*t[1]+t[2]*t[2]}function Ut(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Vt(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function Bt(t,e,i,n,r){let s=1-r,a=s*s;return a*s*t+r*(3*(a*e+r*s*i)+r*r*n)}function Dt(t,e){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function Ct(t,e,i){return[3*(t[0]+i[0])-6*e[0],3*(t[1]+i[1])-6*e[1],3*(t[2]+i[2])-6*e[2]]}function Ft(t,e,i,n){return[n[0]-t[0]+3*(e[0]-i[0]),n[1]-t[1]+3*(e[1]-i[1]),n[2]-t[2]+3*(e[2]-i[2])]}function zt(t,e,i,n){let r=[1/3*(n[0]-t[0]),1/3*(n[1]-t[1]),1/3*(n[2]-t[2])];return Math.max(St([e[0]-r[0]-t[0],e[1]-r[1]-t[1],e[2]-r[2]-t[2]]),St([n[0]-r[0]-i[0],n[1]-r[1]-i[1],n[2]-r[2]-i[2]]))}function Ht(t,e,i,n){let r=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],s=[n[0]-i[0],n[1]-i[1],n[2]-i[2]];return Math.max(St(Vt(r,Pt(s))),St(Vt(s,Pt(r))))/9}function Xt(t){return[Math.min(t[0][0],t[1][0],t[2][0],t[3][0],t[4][0],t[5][0],t[6][0],t[7][0]),Math.min(t[0][1],t[1][1],t[2][1],t[3][1],t[4][1],t[5][1],t[6][1],t[7][1]),Math.min(t[0][2],t[1][2],t[2][2],t[3][2],t[4][2],t[5][2],t[6][2],t[7][2])]}function Gt(t){return[Math.max(t[0][0],t[1][0],t[2][0],t[3][0],t[4][0],t[5][0],t[6][0],t[7][0]),Math.max(t[0][1],t[1][1],t[2][1],t[3][1],t[4][1],t[5][1],t[6][1],t[7][1]),Math.max(t[0][2],t[1][2],t[2][2],t[3][2],t[4][2],t[5][2],t[6][2],t[7][2])]}function Wt(t){ae||oe(),B=!0,D=t.clientX,C=t.clientY}let jt,kt,Yt=!1;function $t(t){return Math.hypot(t[0].pageX-t[1].pageX,t[0].pageY-t[1].pageY)}function qt(t){t.preventDefault(),ae||oe();let e=t.targetTouches;ue=pe=Yt=!1,fe||(1!=e.length||B||(kt=(new Date).getTime(),touchId=e[0].identifier,D=e[0].pageX,C=e[0].pageY),2!=e.length||B||(touchId=e[0].identifier,jt=$t(e),Yt=!0))}function Kt(t){B=!1}function Zt(t,e,i,n,r){if(t==i&&e==n)return;let[s,a]=function(t,e){let i=ne(t),n=ne(e),r=Ut(i,n);return[r>1?0:r<-1?f:Math.acos(r),Pt(Vt(i,n))]}([t,-e],[i,-n]);mat4.fromRotation(O,2*r*R*s/v,a),mat4.multiply(T,O,T)}function Qt(t,e,i,n){let r=1/v;P.x+=(i-t)*r*s,P.y-=(n-e)*r*a}function Jt(t,e,i,n){o.orthographic?Qt(t,e,i,n):(_.x+=(i-t)*(S.xmax-S.xmin),_.y-=(n-e)*(S.ymax-S.ymin))}function te(){var t,e;t=A,e=T,mat4.fromTranslation(O,[_.x,_.y,_.z]),mat4.invert(N,O),mat4.multiply(t,e,N),mat4.multiply(t,O,t),mat4.translate(A,A,[_.x,_.y,0]),mat3.fromMat4(L,A),mat3.invert(I,L),mat4.multiply(E,y,A)}function ee(){let t=Math.sqrt(Number.MAX_VALUE),e=1/t;v<=e&&(v=e),v>=t&&(v=t),(1.5*v<x||v>1.5*x)&&(U=!0,x=v)}function ie(t){let e=o.zoomStep*a*t;const i=Math.log(.1*Number.MAX_VALUE)/Math.log(o.zoomFactor);Math.abs(e)<i&&(v*=o.zoomFactor**e,ee())}function ne(t){let e=t[0],i=t[1],n=Math.hypot(e,i);return n>1&&(denom=1/n,e*=denom,i*=denom),[e,i,Math.sqrt(Math.max(1-i*i-e*e,0))]}function re(t,e,i,n){ie(e-n)}function se(t,e,i,n=1){let r;switch(i){case 1:r=Zt;break;case 2:r=Qt;break;case 3:r=re;break;case 4:r=Jt;break;default:r=(t,e,i,n)=>{}}r((D-s)/s,(C-a)/a,(t-s)/s,(e-a)/a,n),D=t,C=e,Oe(),Ne()}let ae=0;function oe(){ae=1,o.canvas.addEventListener("wheel",de,!1)}function he(){let t,e,i;[t,e,i]=function(){let t=Array(3),e=Array(3),i=Array(3),n=_.x,r=_.y,s=.5*(S.zmin+S.zmax);for(let a=0;a<3;++a){let h=0,l=0,c=0,d=4*a;for(let t=0;t<4;++t){let e=4*t,i=T[e],a=T[e+1],m=T[e+2],f=T[e+3],u=o.Transform[d+t];h+=u*(f-n*i-r*a-s*m),c+=u*a,l+=u*(f-n*i-r*a)}t[a]=h,e[a]=c,i[a]=l}return[t,e,i]}();let n=o.orthographic?" orthographic(":" perspective(",r="".padStart(n.length),s="currentprojection=\n"+n+"camera=("+t+"),\n"+r+"up=("+e+"),\n"+r+"target=("+i+"),\n"+r+"zoom="+v*o.initialZoom/o.zoom0;return o.orthographic||(s+=",\n"+r+"angle="+2*Math.atan(Math.tan(.5*o.angleOfView)/v)/u),0==g&&0==w||(s+=",\n"+r+"viewportshift=("+g+","+w+")"),o.orthographic||(s+=",\n"+r+"autoadjust=false"),s+=");\n",window.parent.asyProjection=!0,s}function le(t){if(ae||oe(),o.embedded&&ae&&27==t.keyCode)return ae=0,void o.canvas.removeEventListener("wheel",de,!1);let e=[];switch(t.key){case"x":e=[1,0,0];break;case"y":e=[0,1,0];break;case"z":e=[0,0,1];break;case"h":mat4.identity(T),Rt(),window.top.asyWebApplication&&window.top.asyWebApplication.setProjection(""),window.parent.asyProjection=!1;break;case"m":++V,3==V&&(V=0),2!=V&&(o.embedded||st(),rt(o.ibl)),U=!0,Ne();break;case"+":case"=":case">":v*=o.zoomFactor,ce();break;case"-":case"_":case"<":v/=o.zoomFactor,ce();break;case"c":window.top.asyWebApplication||prompt("Ctrl+c Enter to copy currentprojection to clipboard; then append to asy file:",he())}e.length>0&&(mat4.rotate(T,T,.1,e),te(),Ne())}function ce(){ee(),Oe(),Ne()}function de(t){t.preventDefault(),t.deltaY<0?v*=o.zoomFactor:v/=o.zoomFactor,ce()}function me(t){if(!B)return;let e,i=t.clientX,n=t.clientY;e=t.getModifierState("Control")?2:t.getModifierState("Shift")?3:t.getModifierState("Alt")?4:1,se(i,n,e)}let fe=!1,ue=!1,pe=!1;function ve(t){if(t.preventDefault(),fe)return;let e=t.targetTouches;if(!Yt&&1==e.length&&touchId==e[0].identifier){let t=e[0].pageX,i=e[0].pageY,n=t-D,r=i-C,s=n*n+r*r<=o.shiftHoldDistance*o.shiftHoldDistance;if(s&&!ue&&!pe&&(new Date).getTime()-kt>o.shiftWaitTime&&(navigator.vibrate&&window.navigator.vibrate(o.vibrateTime),ue=!0),ue)se(t,i,2);else if(!s){pe=!0,se(e[0].pageX,e[0].pageY,1,.5)}}if(Yt&&!ue&&2==e.length&&touchId==e[0].identifier){let t=$t(e),i=t-jt;fe=!0,i*=o.zoomPinchFactor,i>o.zoomPinchCap&&(i=o.zoomPinchCap),i<-o.zoomPinchCap&&(i=-o.zoomPinchCap),ie(i/b),jt=t,ue=pe=fe=!1,Oe(),Ne()}}let xe,ge,we,Me,be=[];function Re(){dt(K,xe),K.clear()}function Te(){dt(Z,ge),Z.clear()}function ye(){dt(Q,ge),Q.clear()}function Ae(){dt(J,we),J.clear()}function Ee(){dt(et,Me),et.rendered=!1,et.clear()}function Ie(){let e=tt.indices;if(V>0)return dt(tt,Me,e),void tt.clear();if(e.length>0){!function(t){let e=A[2],i=A[6],n=A[10];be.length=t.length;for(let r=0;r<t.length;++r){let s=6*r;be[r]=e*t[s]+i*t[s+1]+n*t[s+2]}}(tt.vertices);let i=e.length/3,n=Array(i).fill().map((t,e)=>e);n.sort((function(t,i){let n=3*t;Ia=e[n],Ib=e[n+1],Ic=e[n+2];let r=3*i;return IA=e[r],IB=e[r+1],IC=e[r+2],be[Ia]+be[Ib]+be[Ic]<be[IA]+be[IB]+be[IC]?-1:1}));let r=Array(e.length);for(let t=0;t<i;++t){let i=3*n[t];r[3*t]=e[i],r[3*t+1]=e[i+1],r[3*t+2]=e[i+2]}t.depthMask(!1),dt(tt,Me,r),tt.rendered=!1,t.depthMask(!0)}tt.clear()}function Le(){Re(),Te(),ye(),Ae(),Ee(),Ie(),requestAnimationFrame(Le)}function Ne(){o.embedded&&(i.width=o.canvasWidth,i.height=o.canvasHeight,_e()),t.clearColor(o.background[0],o.background[1],o.background[2],o.background[3]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);for(const t of h)t.render();Le(),o.embedded&&(n.clearRect(0,0,o.canvasWidth,o.canvasHeight),n.drawImage(i,0,0)),0==V&&(U=!1)}function Oe(){!function(t,e,i,n){let r=t/e;g=(i/t+o.viewportShift[0])*v,w=(n/e+o.viewportShift[1])*v;let s=1/v;if(o.orthographic){let t=o.maxBound[0]-o.minBound[0],e=o.maxBound[1]-o.minBound[1];if(t<e*r){let t=.5*e*r*s,i=2*t*g,n=e*s*w;S.xmin=-t-i,S.xmax=t-i,S.ymin=o.minBound[1]*s-n,S.ymax=o.maxBound[1]*s-n}else{let e=.5*t*s/r,i=t*s*g,n=2*e*w;S.xmin=o.minBound[0]*s-i,S.xmax=o.maxBound[0]*s-i,S.ymin=-e-n,S.ymax=e-n}}else{let t=M*s,e=t*r,i=2*e*g,n=2*t*w;S.xmin=-e-i,S.xmax=e-i,S.ymin=-t-n,S.ymax=t-n}}(o.canvasWidth,o.canvasHeight,P.x,P.y),(o.orthographic?mat4.ortho:mat4.frustum)(y,S.xmin,S.xmax,S.ymin,S.ymax,-S.zmax,-S.zmin),te(),window.top.asyWebApplication&&window.top.asyWebApplication.setProjection(he())}function _e(){t.viewportWidth=o.canvasWidth,t.viewportHeight=o.canvasHeight,t.viewport(.5*(o.canvas.width-o.canvasWidth),.5*(o.canvas.height-o.canvasHeight),o.canvasWidth,o.canvasHeight),t.scissor(0,0,o.canvas.width,o.canvas.height)}function Pe(t,e){t>void 0&&(t=void 0),e>void 0&&(e=void 0),P.x*=t/o.canvasWidth,P.y*=e/o.canvasHeight,o.canvasWidth=t,o.canvasHeight=e,o.embedded&&(o.canvas.width=i.width=o.canvasWidth,o.canvas.height=i.height=o.canvasHeight),b=Math.hypot(o.canvasWidth,o.canvasHeight),s=.5*o.canvas.width,a=.5*o.canvas.height,R=1+8*Math.hypot(o.viewportMargin[0],o.viewportMargin[1])/b,_e(),Oe(),U=!0}function Se(){if(o.zoom0=o.initialZoom,window.top.asyWebApplication&&""==window.top.asyWebApplication.getProjection()&&(window.parent.asyProjection=!1),o.absolute&&!o.embedded)o.canvasWidth=o.canvasWith0*window.devicePixelRatio,o.canvasHeight=o.canvasHeight0*window.devicePixelRatio;else{let t=o.canvasWith0/o.canvasHeight0;o.canvasWidth=Math.max(window.innerWidth-10,10),o.canvasHeight=Math.max(window.innerHeight-10,10),!o.orthographic&&!window.parent.asyProjection&&o.canvasWidth<o.canvasHeight*t&&(o.zoom0*=o.canvasWidth/(o.canvasHeight*t))}o.canvas.width=o.canvasWidth,o.canvas.height=o.canvasHeight;window.innerWidth,window.innerHeight;let t=1/o.zoom0;o.viewportShift[0]*=t,o.viewportShift[1]*=t,Pe(o.canvasWidth,o.canvasHeight),Rt()}class Ue{constructor(t,e){if(this.center=t,e){let t=e[0],i=e[1];this.ct=Math.cos(t),this.st=Math.sin(t),this.cp=Math.cos(i),this.sp=Math.sin(i)}}T0(t){return[t[0]+this.center[0],t[1]+this.center[1],t[2]+this.center[2]]}T(t){let e=t[0],i=t[1],n=t[2],r=e*this.ct+n*this.st;return[r*this.cp-i*this.sp+this.center[0],r*this.sp+i*this.cp+this.center[1],-e*this.st+n*this.ct+this.center[2]]}}function Ve(t,e,i){let n=[t(e),t([e[0],e[1],i[2]]),t([e[0],i[1],e[2]]),t([e[0],i[1],i[2]]),t([i[0],e[1],e[2]]),t([i[0],e[1],i[2]]),t([i[0],i[1],e[2]]),t(i)];return[Xt(n),Gt(n)]}let Be=4/3*(Math.sqrt(2)-1);async function De(t){return(await fetch(t)).arrayBuffer()}function Ce(t){return t.getBytes().filter((t,e)=>e%4!=3)}function Fe(e,i,n=t.RGB16F){let r=e.width(),s=e.height(),a=t.createTexture();return t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,a),t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,n,r,s,0,t.RGB,t.FLOAT,Ce(e)),a}window.webGLStart=function(){o.canvas=document.getElementById("Asymptote"),o.embedded=window.top.document!=document,ht(),t.enable(t.BLEND),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA),t.enable(t.DEPTH_TEST),t.enable(t.SCISSOR_TEST),o.canvas.onmousedown=Wt,document.onmouseup=Kt,document.onmousemove=me,o.canvas.onkeydown=le,o.embedded||oe(),o.canvas.addEventListener("touchstart",qt,!1),o.canvas.addEventListener("touchend",Kt,!1),o.canvas.addEventListener("touchcancel",Kt,!1),o.canvas.addEventListener("touchleave",Kt,!1),o.canvas.addEventListener("touchmove",ve,!1),document.addEventListener("keydown",le,!1),o.canvasWith0=o.canvasWidth,o.canvasHeight0=o.canvasHeight,mat4.identity(T),0!=window.innerWidth&&0!=window.innerHeight&&Se(),window.addEventListener("resize",Se,!1),o.ibl&&async function(){let e=o.imageURL+o.image+"/";function i(t){return new Promise(e=>setTimeout(e,t))}for(;!Module.EXRLoader;)await i(0);promises=[De(o.imageURL+"refl.exr").then(t=>{let e=new Module.EXRLoader(t);j=Fe(e,0)}),De(e+"diffuse.exr").then(t=>{let e=new Module.EXRLoader(t);W=Fe(e,1)})],refl_promise=[],refl_promise.push(De(e+"refl0.exr"));for(let t=1;t<=8;++t)refl_promise.push(De(e+"refl"+t+"w.exr"));finished_promise=Promise.all(refl_promise).then(e=>{let i=t.createTexture();t.activeTexture(t.TEXTURE0+2),t.pixelStorei(t.UNPACK_ALIGNMENT,1),t.bindTexture(t.TEXTURE_2D,i),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAX_LEVEL,e.length-1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR_MIPMAP_LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameterf(t.TEXTURE_2D,t.TEXTURE_MIN_LOD,0),t.texParameterf(t.TEXTURE_2D,t.TEXTURE_MAX_LOD,8);for(let i=0;i<e.length;++i){let n=new Module.EXRLoader(e[i]);t.texImage2D(t.TEXTURE_2D,i,t.RGB16F,n.width(),n.height(),0,t.RGB,t.FLOAT,Ce(n))}G=i}),promises.push(finished_promise),await Promise.all(promises)}().then(k).then(Rt)},window.light=function(t,e){l.push(new nt(t,e))},window.material=function(t,e,i,n,r,s){c.push(new Y(t,e,i,n,r,s))},window.patch=function(t,e,i,n){h.push(new vt(t,e,i,n))},window.curve=function(t,e,i){h.push(new wt(t,e,i))},window.pixel=function(t,e,i){h.push(new Mt(t,e,i))},window.triangles=function(t,e){h.push(new bt(t,e))},window.sphere=function(t,e,i,n,r){let s,a,o,l,c,d,m=.524670512339254,f=.595936986722291,u=.954967051233925,p=.0820155480083437,v=.996685028842544,x=.0549670512339254,g=.998880711874577,w=.0405017186586849,M=[[[1,0,0],[1,0,m],[f,0,u],[p,0,v],[1,Be,0],[1,Be,m],[f,Be*f,u],[p,Be*p,v],[Be,1,0],[Be,1,m],[Be*f,f,u],[Be*p,p,v],[0,1,0],[0,1,m],[0,f,u],[0,p,v]],[[p,0,v],[p,Be*p,v],[x,0,g],[Be*p,p,v],[w,w,1],[.05*Be,0,1],[0,p,v],[0,x,g],[0,.05*Be,1],[0,0,1]]],b=new Ue(t,r);function R(t){let e=Array(t.length);for(let i=0;i<t.length;++i){let n=t[i];e[i]=c([s*n[0],a*n[1],o*n[2]])}return e}r?(l=1,d=0,c=b.T.bind(b)):(l=-1,d=-e,c=b.T0.bind(b));let T=Ve(c,[-e,-e,d],[e,e,e]),y=T[0],A=T[1];for(let t=-1;t<=1;t+=2){s=t*e;for(let t=-1;t<=1;t+=2){a=t*e;for(let t=l;t<=1;t+=2){o=t*e;for(let t=0;t<2;++t)h.push(new vt(R(M[t]),i,n,null,y,A))}}}},window.disk=function(t,e,i,n,r){let s=1-2*Be/3,a=[[1,0,0],[1,-Be,0],[Be,-1,0],[0,-1,0],[1,Be,0],[s,0,0],[0,-s,0],[-Be,-1,0],[Be,1,0],[0,s,0],[-s,0,0],[-1,-Be,0],[0,1,0],[-Be,1,0],[-1,Be,0],[-1,0,0]],o=new Ue(t,r),l=Ve(o.T.bind(o),[-e,-e,0],[e,e,0]);h.push(new vt(function(t){let i=Array(t.length);for(let n=0;n<t.length;++n){let r=t[n];i[n]=o.T([e*r[0],e*r[1],0])}return i}(a),i,n,null,l[0],l[1]))},window.cylinder=function(t,e,i,n,r,s,a){let o,l,c=[[1,0,0],[1,0,1/3],[1,0,2/3],[1,0,1],[1,Be,0],[1,Be,1/3],[1,Be,2/3],[1,Be,1],[Be,1,0],[Be,1,1/3],[Be,1,2/3],[Be,1,1],[0,1,0],[0,1,1/3],[0,1,2/3],[0,1,1]],d=new Ue(t,s);function m(t){let e=Array(t.length);for(let n=0;n<t.length;++n){let r=t[n];e[n]=d.T([o*r[0],l*r[1],i*r[2]])}return e}let f=Ve(d.T.bind(d),[-e,-e,0],[e,e,i]),u=f[0],p=f[1];for(let t=-1;t<=1;t+=2){o=t*e;for(let t=-1;t<=1;t+=2)l=t*e,h.push(new vt(m(c),n,r,null,u,p))}if(a){let e=d.T([0,0,i]);h.push(new wt([t,e],n,r,t,e))}},window.tube=function(t,e,i,n,r){let s=function(t,e,i,n,r){class s{constructor(t,e,i){this.p=t,this.r=e,this.t=i,this.s=Vt(i,e)}}let a=Number.EPSILON*Math.max(St(t),St(e),St(i),St(n));function o(r){if(1==r){let r=[n[0]-i[0],n[1]-i[1],n[2]-i[2]];return St(r)>a?Pt(r):(r=[2*i[0]-e[0]-n[0],2*i[1]-e[1]-n[1],2*i[2]-e[2]-n[2]],St(r)>a?Pt(r):[n[0]-t[0]+3*(e[0]-i[0]),n[1]-t[1]+3*(e[1]-i[1]),n[2]-t[2]+3*(e[2]-i[2])])}let s=[n[0]-t[0]+3*(e[0]-i[0]),n[1]-t[1]+3*(e[1]-i[1]),n[2]-t[2]+3*(e[2]-i[2])],o=[2*(t[0]+i[0])-4*e[0],2*(t[1]+i[1])-4*e[1],2*(t[2]+i[2])-4*e[2]],h=[e[0]-t[0],e[1]-t[1],e[2]-t[2]],l=r*r,c=[s[0]*l+o[0]*r+h[0],s[1]*l+o[1]*r+h[1],s[2]*l+o[2]*r+h[2]];return St(c)>a?Pt(c):(l=2*r,c=[s[0]*l+o[0],s[1]*l+o[1],s[2]*l+o[2]],St(c)>a?Pt(c):Pt(s))}let h=Array(r.length),l=[e[0]-t[0],e[1]-t[1],e[2]-t[2]];St(l)<a&&(l=[t[0]-2*e[0]+i[0],t[1]-2*e[1]+i[1],t[2]-2*e[2]+i[2]],St(l)<a&&(l=[n[0]-t[0]+3*(e[0]-i[0]),n[1]-t[1]+3*(e[1]-i[1]),n[2]-t[2]+3*(e[2]-i[2])])),l=Pt(l);let c=function(t){let e=Vt(t,[0,1,0]),i=Number.EPSILON*St(t);return St(e)>i?Pt(e):(e=Vt(t,[0,0,1]),St(e)>i?Pt(e):[1,0,0])}(l);h[0]=new s(t,c,l);for(let a=1;a<r.length;++a){let l=h[a-1],c=r[a],d=1-c,m=d*d,f=m*d,u=3*c;m*=u,d*=u*c;let p=c*c*c,v=[f*t[0]+m*e[0]+d*i[0]+p*n[0],f*t[1]+m*e[1]+d*i[1]+p*n[1],f*t[2]+m*e[2]+d*i[2]+p*n[2]],x=[v[0]-l.p[0],v[1]-l.p[1],v[2]-l.p[2]];if(0!=x[0]||0!=x[1]||0!=x[2]){let t=l.r,e=Pt(x),i=l.t,n=Ut(e,i),r=[i[0]-2*n*e[0],i[1]-2*n*e[1],i[2]-2*n*e[2]];i=o(c);let d=2*Ut(e,t),m=[t[0]-d*e[0],t[1]-d*e[1],t[2]-d*e[2]],f=Pt([i[0]-r[0],i[1]-r[1],i[2]-r[2]]),u=2*Ut(f,m);m=[m[0]-u*f[0],m[1]-u*f[1],m[2]-u*f[2]],h[a]=new s(v,Pt(m),Pt(i))}else h[a]=h[a-1]}return h}(t[0],t[1],t[2],t[3],[0,1/3,2/3,1]),a=Be*e,o=[[e,0],[e,a],[a,e],[0,e]];function l(e,r,a,l){let c=Array(16);for(let i=0;i<4;++i){let n=s[i],h=n.r[0],d=n.s[0],m=h*e+d*r,f=h*a+d*l;h=n.r[1],d=n.s[1];let u=h*e+d*r,p=h*a+d*l;h=n.r[2],d=n.s[2];let v=h*e+d*r,x=h*a+d*l,g=t[i],w=g[0];w1=g[1],w2=g[2];for(let t=0;t<4;++t){let e=o[t],n=e[0],r=e[1];c[4*i+t]=[m*n+f*r+w,u*n+p*r+w1,v*n+x*r+w2]}}h.push(new vt(c,i,n))}l(1,0,0,1),l(0,-1,1,0),l(-1,0,0,-1),l(0,1,-1,0),r&&h.push(new wt(t,i,n))}}(); diff --git a/graphics/asymptote/bezierpatch.cc b/graphics/asymptote/bezierpatch.cc index f210c538c2..775c282e0c 100644 --- a/graphics/asymptote/bezierpatch.cc +++ b/graphics/asymptote/bezierpatch.cc @@ -23,12 +23,16 @@ const double FillFactor=0.1; void BezierPatch::init(double res) { res2=res*res; - Epsilon=FillFactor*res; - MaterialIndex=transparent ? - (color ? -1-materialIndex : 1+materialIndex) : materialIndex; - - pvertex=transparent ? &vertexBuffer::tvertex : &vertexBuffer::vertex; + if(transparent) { + Epsilon=0.0; + MaterialIndex=color ? -1-materialIndex : 1+materialIndex; + pvertex=&vertexBuffer::tvertex; + } else { + Epsilon=FillFactor*res; + MaterialIndex=materialIndex; + pvertex=&vertexBuffer::vertex; + } } void BezierPatch::render(const triple *p, bool straight, GLfloat *c0) @@ -222,16 +226,18 @@ void BezierPatch::render(const triple *p, triple m0=0.5*(P1+P2); if(!flat1) { - if((flat1=Straightness(p12,p[13],p[14],p15) < res2)) - m0 -= Epsilon*unit(differential(s1[12],s1[8],s1[4],s1[0])); - else m0=s0[15]; + if((flat1=Straightness(p12,p[13],p[14],p15) < res2)) { + if(Epsilon) + m0 -= Epsilon*unit(differential(s1[12],s1[8],s1[4],s1[0])); + } else m0=s0[15]; } triple m1=0.5*(P3+P0); if(!flat3) { - if((flat3=Straightness(p0,p[1],p[2],p3) < res2)) - m1 -= Epsilon*unit(differential(s0[3],s0[7],s0[11],s0[15])); - else m1=s1[0]; + if((flat3=Straightness(p0,p[1],p[2],p3) < res2)) { + if(Epsilon) + m1 -= Epsilon*unit(differential(s0[3],s0[7],s0[11],s0[15])); + } else m1=s1[0]; } if(color) { @@ -312,16 +318,18 @@ void BezierPatch::render(const triple *p, triple m0=0.5*(P0+P1); if(!flat0) { - if((flat0=Straightness(p0,p[4],p[8],p12) < res2)) - m0 -= Epsilon*unit(differential(s1[0],s1[1],s1[2],s1[3])); - else m0=s0[12]; + if((flat0=Straightness(p0,p[4],p[8],p12) < res2)) { + if(Epsilon) + m0 -= Epsilon*unit(differential(s1[0],s1[1],s1[2],s1[3])); + } else m0=s0[12]; } triple m1=0.5*(P2+P3); if(!flat2) { - if((flat2=Straightness(p15,p[11],p[7],p3) < res2)) - m1 -= Epsilon*unit(differential(s0[15],s0[14],s0[13],s0[12])); - else m1=s1[3]; + if((flat2=Straightness(p15,p[11],p[7],p3) < res2)) { + if(Epsilon) + m1 -= Epsilon*unit(differential(s0[15],s0[14],s0[13],s0[12])); + } else m1=s1[3]; } if(color) { @@ -428,30 +436,34 @@ void BezierPatch::render(const triple *p, triple m0=0.5*(P0+P1); if(!flat0) { - if((flat0=Straightness(p0,p[4],p[8],p12) < res2)) - m0 -= Epsilon*unit(differential(s1[0],s1[1],s1[2],s1[3])); - else m0=s0[12]; + if((flat0=Straightness(p0,p[4],p[8],p12) < res2)) { + if(Epsilon) + m0 -= Epsilon*unit(differential(s1[0],s1[1],s1[2],s1[3])); + } else m0=s0[12]; } triple m1=0.5*(P1+P2); if(!flat1) { - if((flat1=Straightness(p12,p[13],p[14],p15) < res2)) - m1 -= Epsilon*unit(differential(s2[12],s2[8],s2[4],s2[0])); - else m1=s1[15]; + if((flat1=Straightness(p12,p[13],p[14],p15) < res2)) { + if(Epsilon) + m1 -= Epsilon*unit(differential(s2[12],s2[8],s2[4],s2[0])); + } else m1=s1[15]; } triple m2=0.5*(P2+P3); if(!flat2) { - if((flat2=Straightness(p15,p[11],p[7],p3) < res2)) - m2 -= Epsilon*unit(differential(s3[15],s3[14],s3[13],s3[12])); - else m2=s2[3]; + if((flat2=Straightness(p15,p[11],p[7],p3) < res2)) { + if(Epsilon) + m2 -= Epsilon*unit(differential(s3[15],s3[14],s3[13],s3[12])); + } else m2=s2[3]; } triple m3=0.5*(P3+P0); if(!flat3) { - if((flat3=Straightness(p0,p[1],p[2],p3) < res2)) - m3 -= Epsilon*unit(differential(s0[3],s0[7],s0[11],s0[15])); - else m3=s3[0]; + if((flat3=Straightness(p0,p[1],p[2],p3) < res2)) { + if(Epsilon) + m3 -= Epsilon*unit(differential(s0[3],s0[7],s0[11],s0[15])); + } else m3=s3[0]; } if(color) { @@ -681,26 +693,29 @@ void BezierTriangle::render(const triple *p, triple m0=0.5*(P1+P2); if(!flat0) { - if((flat0=Straightness(r300,p210,p120,u030) < res2)) - m0 -= Epsilon*unit(differential(c[0],c[2],c[5],c[9])+ - differential(c[0],c[1],c[3],c[6])); - else m0=r030; + if((flat0=Straightness(r300,p210,p120,u030) < res2)) { + if(Epsilon) + m0 -= Epsilon*unit(differential(c[0],c[2],c[5],c[9])+ + differential(c[0],c[1],c[3],c[6])); + } else m0=r030; } triple m1=0.5*(P2+P0); if(!flat1) { - if((flat1=Straightness(l003,p012,p021,u030) < res2)) - m1 -= Epsilon*unit(differential(c[6],c[3],c[1],c[0])+ - differential(c[6],c[7],c[8],c[9])); - else m1=l030; + if((flat1=Straightness(l003,p012,p021,u030) < res2)) { + if(Epsilon) + m1 -= Epsilon*unit(differential(c[6],c[3],c[1],c[0])+ + differential(c[6],c[7],c[8],c[9])); + } else m1=l030; } triple m2=0.5*(P0+P1); if(!flat2) { - if((flat2=Straightness(l003,p102,p201,r300) < res2)) - m2 -= Epsilon*unit(differential(c[9],c[8],c[7],c[6])+ - differential(c[9],c[5],c[2],c[0])); - else m2=l300; + if((flat2=Straightness(l003,p102,p201,r300) < res2)) { + if(Epsilon) + m2 -= Epsilon*unit(differential(c[9],c[8],c[7],c[6])+ + differential(c[9],c[5],c[2],c[0])); + } else m2=l300; } if(color) { diff --git a/graphics/asymptote/binaries/x86_64-windows/cygwin1.dll b/graphics/asymptote/binaries/x86_64-windows/cygwin1.dll Binary files differindex 6480df87f2..fcd3430a86 100644 --- a/graphics/asymptote/binaries/x86_64-windows/cygwin1.dll +++ b/graphics/asymptote/binaries/x86_64-windows/cygwin1.dll diff --git a/graphics/asymptote/build-scripts/build-asygl b/graphics/asymptote/build-scripts/build-asygl index 559b08c08b..0c8eeb88f7 100755 --- a/graphics/asymptote/build-scripts/build-asygl +++ b/graphics/asymptote/build-scripts/build-asygl @@ -9,7 +9,7 @@ UGLIFYOPT=""; \ else \ UGLIFY=terser; \ UGLIFYOPTIONS="-m -c --comments"; \ -fi +fi GL_MATRIX_VERSION=2.4.0 GL_MATRIX_DIR=gl-matrix-$GL_MATRIX_VERSION @@ -34,7 +34,7 @@ echo "let vertex=\`" > $SHADERS echo "\`;" | cat webgl/vertex.glsl - >> $SHADERS echo "let fragment=\`" >> $SHADERS echo "\`;" | cat webgl/fragment.glsl - >> $SHADERS -cat webgl/license $GL_MATRIX_DIR_PRUNED/LICENSE.js \ - $SHADERS $GL_MATRIX_DIR_PRUNED/dist/gl-matrix.js webgl/gl.js | \ +echo | cat webgl/license $GL_MATRIX_DIR_PRUNED/LICENSE.js \ + $SHADERS $GL_MATRIX_DIR_PRUNED/dist/gl-matrix.js - webgl/gl.js | \ $UGLIFY $UGLIFYOPTIONS > base/webgl/asygl.js rm $SHADERS diff --git a/graphics/asymptote/config.h.in b/graphics/asymptote/config.h.in index fd317eab6b..891681e848 100644 --- a/graphics/asymptote/config.h.in +++ b/graphics/asymptote/config.h.in @@ -21,6 +21,9 @@ /* Define to 1 if you have the <editline/readline.h> header file. */ #undef HAVE_EDITLINE_READLINE_H +/* Define to 1 if you have the <Eigen/Dense> header file. */ +#undef HAVE_EIGEN_DENSE + /* Define to 1 if you have the `feenableexcept' function. */ #undef HAVE_FEENABLEEXCEPT diff --git a/graphics/asymptote/configure b/graphics/asymptote/configure index bc4951f56e..f4395d377f 100755 --- a/graphics/asymptote/configure +++ b/graphics/asymptote/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Asymptote 2.80. +# Generated by GNU Autoconf 2.69 for Asymptote 2.82. # # Report bugs to <https://github.com/vectorgraphics/asymptote/issues>. # @@ -581,8 +581,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Asymptote' PACKAGE_TARNAME='asymptote' -PACKAGE_VERSION='2.80' -PACKAGE_STRING='Asymptote 2.80' +PACKAGE_VERSION='2.82' +PACKAGE_STRING='Asymptote 2.82' PACKAGE_BUGREPORT='https://github.com/vectorgraphics/asymptote/issues' PACKAGE_URL='' @@ -734,6 +734,7 @@ enable_curl enable_readline enable_static enable_fftw +enable_eigen enable_gsl enable_gl enable_offscreen @@ -1304,7 +1305,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Asymptote 2.80 to adapt to many kinds of systems. +\`configure' configures Asymptote 2.82 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1370,7 +1371,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Asymptote 2.80:";; + short | recursive ) echo "Configuration of Asymptote 2.82:";; esac cat <<\_ACEOF @@ -1391,6 +1392,7 @@ Optional Features: --enable-readline[=yes] enable GNU Readline Library --enable-static[=no] link against static libraries --enable-fftw[=yes] enable FFTW Library + --enable-eigen[=yes] enable Eigen Library --enable-gsl[=yes] enable GNU Scientific Library --enable-gl[=yes] enable OpenGL Library --enable-offscreen[=no] use OSMesa library to implement offscreen rendering @@ -1489,7 +1491,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Asymptote configure 2.80 +Asymptote configure 2.82 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2075,7 +2077,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Asymptote $as_me 2.80, which was +It was created by Asymptote $as_me 2.82, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -5900,7 +5902,7 @@ fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ASYGLVERSION=1.01 +ASYGLVERSION=1.02 GCVERSION=8.2.0 ATOMICVERSION=7.6.12 @@ -6064,8 +6066,6 @@ $as_echo "$as_me: *** Enabling GC backtrace debugging; remember to make gc-clean fi -INCL=$INCL" -I/usr/include/tirpc" - if test "$OSTYPE" = "msdos"; then CPPFLAGS=$CPPFLAGS" -D__MSDOS__ -I/usr/include/w32api -I/usr/include -DCALLBACK=__stdcall $INCL" else @@ -6890,6 +6890,8 @@ fi if test "x$enable_readline" != "xno"; then +CPPFLAGS="$CPPFLAGS "`pkg-config --cflags readline` +LDFLAGS="$LDFLAGS "`pkg-config --libs readline` cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7529,7 +7531,8 @@ fi if test "x$enable_fftw" != "xno"; then - +CPPFLAGS="$CPPFLAGS "`pkg-config --cflags fftw3` +LDFLAGS="$LDFLAGS "`pkg-config --libs fftw3` ac_fn_cxx_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" if test "x$ac_cv_header_fftw3_h" = xyes; then : @@ -7649,6 +7652,28 @@ fi fi +# Check whether --enable-eigen was given. +if test "${enable_eigen+set}" = set; then : + enableval=$enable_eigen; +fi + + +if test "x$enable_eigen" != "xno"; then +CPPFLAGS="$CPPFLAGS "`pkg-config --cflags eigen3` +for ac_header in Eigen/Dense +do : + ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Dense" "ac_cv_header_Eigen_Dense" "$ac_includes_default" +if test "x$ac_cv_header_Eigen_Dense" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_EIGEN_DENSE 1 +_ACEOF + +fi + +done + +fi + # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } @@ -7728,6 +7753,14 @@ fi done +case "$OSTYPE" in + darwin*) + ;; + *) + CPPFLAGS="$CPPFLAGS "`pkg-config --cflags libtirpc` + LDFLAGS="$LDFLAGS "`pkg-config --libs libtirpc` + ;; +esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7813,6 +7846,8 @@ fi if test "x$enable_gsl" != "xno"; then + CPPFLAGS="$CPPFLAGS "`pkg-config --cflags gsl` + LDFLAGS="$LDFLAGS "`pkg-config --libs gsl` ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_sf.h" "ac_cv_header_gsl_gsl_sf_h" "$ac_includes_default" if test "x$ac_cv_header_gsl_gsl_sf_h" = xyes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gsl_sf_debye_6 in -lgsl" >&5 @@ -9486,7 +9521,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Asymptote $as_me 2.80, which was +This file was extended by Asymptote $as_me 2.82, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -9548,7 +9583,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Asymptote config.status 2.80 +Asymptote config.status 2.82 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/graphics/asymptote/configure.ac b/graphics/asymptote/configure.ac index 786fe9438c..9e5b1a8c13 100644 --- a/graphics/asymptote/configure.ac +++ b/graphics/asymptote/configure.ac @@ -3,7 +3,7 @@ # this file. AC_PREREQ(2) -AC_INIT([Asymptote],[2.80],[https://github.com/vectorgraphics/asymptote/issues]) +AC_INIT([Asymptote],[2.82],[https://github.com/vectorgraphics/asymptote/issues]) VERSION=$PACKAGE_VERSION AC_SUBST(VERSION) m4_include([ax_pthread.m4]) @@ -148,7 +148,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM( DEFINE([<unordered_map>])), [AC_CHECK_HEADER(ext/hash_map,,OPTIONS=$OPTIONS"-DNOHASH ")])]) -ASYGLVERSION=1.01 +ASYGLVERSION=1.02 GCVERSION=8.2.0 ATOMICVERSION=7.6.12 @@ -236,8 +236,6 @@ AC_ARG_ENABLE(gc-full-debug, fi ]) -INCL=$INCL" -I/usr/include/tirpc" - if test "$OSTYPE" = "msdos"; then CPPFLAGS=$CPPFLAGS" -D__MSDOS__ -I/usr/include/w32api -I/usr/include -DCALLBACK=__stdcall $INCL" else @@ -350,6 +348,8 @@ LDFLAGS=$LDFLAGS0 ]) if test "x$enable_readline" != "xno"; then +CPPFLAGS="$CPPFLAGS "`pkg-config --cflags readline` +LDFLAGS="$LDFLAGS "`pkg-config --libs readline` AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #include <stdio.h> @@ -374,19 +374,36 @@ AC_ARG_ENABLE(fftw, [AS_HELP_STRING(--enable-fftw[[[=yes]]],enable FFTW Library)]) if test "x$enable_fftw" != "xno"; then - +CPPFLAGS="$CPPFLAGS "`pkg-config --cflags fftw3` +LDFLAGS="$LDFLAGS "`pkg-config --libs fftw3` AC_CHECK_HEADER(fftw3.h, AC_CHECK_LIB_STATIC([fftw3],[fftw_execute],HAVE_LIBFFTW3, AC_MSG_NOTICE([*** Could not find libfftw3: will compile without optional fast Fourier transforms. ***])), AC_MSG_NOTICE([*** Header file fftw3.h not found: will compile without optional fast Fourier transforms. ***])) fi +AC_ARG_ENABLE(eigen, +[AS_HELP_STRING(--enable-eigen[[[=yes]]],enable Eigen Library)]) + +if test "x$enable_eigen" != "xno"; then +CPPFLAGS="$CPPFLAGS "`pkg-config --cflags eigen3` +AC_CHECK_HEADERS(Eigen/Dense) +fi + # Checks for header files. AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([fenv.h stddef.h libintl.h]) AC_CHECK_HEADERS(fpu_control.h) AC_CHECK_FUNCS([feenableexcept]) +case "$OSTYPE" in + darwin*) + ;; + *) + CPPFLAGS="$CPPFLAGS "`pkg-config --cflags libtirpc` + LDFLAGS="$LDFLAGS "`pkg-config --libs libtirpc` + ;; +esac AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "xstream.h"])], [AC_SEARCH_LIBS([xdrstdio_create],[nsl tirpc]) @@ -398,6 +415,8 @@ AC_ARG_ENABLE(gsl, [AS_HELP_STRING(--enable-gsl[[[=yes]]],enable GNU Scientific Library)]) if test "x$enable_gsl" != "xno"; then + CPPFLAGS="$CPPFLAGS "`pkg-config --cflags gsl` + LDFLAGS="$LDFLAGS "`pkg-config --libs gsl` AC_CHECK_HEADER(gsl/gsl_sf.h, AC_CHECK_LIB([gsl], gsl_sf_debye_6, [AC_DEFINE(HAVE_LIBGSL,1, DEFINE_LIB[gsl]) LIBS=$LIBS"-lgsl -lgslcblas "], diff --git a/graphics/asymptote/doc/CAD.pdf b/graphics/asymptote/doc/CAD.pdf Binary files differindex 932ae62e56..ae3216bf64 100644 --- a/graphics/asymptote/doc/CAD.pdf +++ b/graphics/asymptote/doc/CAD.pdf diff --git a/graphics/asymptote/doc/FAQ/asy-faq.info b/graphics/asymptote/doc/FAQ/asy-faq.info index 3eea4bd647..3ae5ddb680 100644 --- a/graphics/asymptote/doc/FAQ/asy-faq.info +++ b/graphics/asymptote/doc/FAQ/asy-faq.info @@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir) ASYMPTOTE FREQUENTLY ASKED QUESTIONS - 2022-04-06 + 2022-08-06 This is the list of Frequently Asked Questions about Asymptote (asy). diff --git a/graphics/asymptote/doc/TeXShopAndAsymptote.pdf b/graphics/asymptote/doc/TeXShopAndAsymptote.pdf Binary files differindex 47268f9dd2..63a205ed52 100644 --- a/graphics/asymptote/doc/TeXShopAndAsymptote.pdf +++ b/graphics/asymptote/doc/TeXShopAndAsymptote.pdf diff --git a/graphics/asymptote/doc/asy-latex.pdf b/graphics/asymptote/doc/asy-latex.pdf Binary files differindex 78cb8f197e..32ad13ce2f 100644 --- a/graphics/asymptote/doc/asy-latex.pdf +++ b/graphics/asymptote/doc/asy-latex.pdf diff --git a/graphics/asymptote/doc/asy.1 b/graphics/asymptote/doc/asy.1 index 92f7615415..04580bd473 100644 --- a/graphics/asymptote/doc/asy.1 +++ b/graphics/asymptote/doc/asy.1 @@ -31,6 +31,9 @@ in the user's home directory using the long form: For a complete description, see the Info files. .TP +.B \-GPUblockSize n +Compute shader block size [8]. +.TP .B \-GPUcompress Compress GPU transparent fragment counts [false]. .TP @@ -41,7 +44,7 @@ Compute indexing partial sums on GPU [true]. Use fragment shader interlock [true]. .TP .B \-GPUlocalSize n -Compute shader local size [16]. +Compute shader local size [256]. .TP .B \-V,\-View View output; command-line only. @@ -116,7 +119,7 @@ Default output file precision [7]. Garbage collect using purge(divisor=n) [2]. .TP .B \-dvisvgmMultipleFiles -dvisvgm supports multiple files [false]. +dvisvgm supports multiple files [true]. .TP .B \-embed Embed rendered preview image [true]. diff --git a/graphics/asymptote/doc/asyRefCard.pdf b/graphics/asymptote/doc/asyRefCard.pdf Binary files differindex 68ab41f84a..c1ba046670 100644 --- a/graphics/asymptote/doc/asyRefCard.pdf +++ b/graphics/asymptote/doc/asyRefCard.pdf diff --git a/graphics/asymptote/doc/asymptote.pdf b/graphics/asymptote/doc/asymptote.pdf Binary files differindex c61d63c4a4..fe7bc493e3 100644 --- a/graphics/asymptote/doc/asymptote.pdf +++ b/graphics/asymptote/doc/asymptote.pdf diff --git a/graphics/asymptote/doc/asymptote.texi b/graphics/asymptote/doc/asymptote.texi index ff7df7a7bb..3b47d1f57d 100644 --- a/graphics/asymptote/doc/asymptote.texi +++ b/graphics/asymptote/doc/asymptote.texi @@ -769,7 +769,7 @@ setlocal errorformat=%f:\ %l.%c:\ %m Syntax highlighting support for the @acronym{KDE} editor @code{Kate} can be enabled by running @code{asy-kate.sh} in the @code{@value{Datadir}/asymptote} directory and putting the generated -@code{asymptote.xml} file in @code{~/.kde/share/apps/katepart/syntax/}. +@code{asymptote.xml} file in @code{~/.local/share/org.kde.syntax-highlighting/syntax/}. @node Git, Uninstall, Editing modes, Installation @section Git @@ -4048,6 +4048,7 @@ value, @code{settings.scroll=0}, specifies continuous scrolling. The routines @cindex @code{getstring} +@cindex @code{getint} @cindex @code{getreal} @cindex @code{getpair} @cindex @code{gettriple} @@ -4286,7 +4287,7 @@ structure. Trying to use a field of a null reference will cause an error. @cindex @code{!=} The function @code{bool alias(T,T)} checks to see if two structure references refer to the same instance of the structure (or both to @code{null}). -In example at the beginning of this section, @code{alias(foo,bar)} +In the example at the beginning of this section, @code{alias(foo,bar)} would return true, but @code{alias(foo,new T)} would return false, as @code{new T} creates a new instance of the structure @code{T}. The boolean operators @code{==} and @code{!=} are by default equivalent to @code{alias} and @@ -5570,6 +5571,19 @@ using the given @code{sign}; returns the unnormalized three-dimensional Fourier transform of @code{a} using the given @code{sign}; +@cindex @code{realschur} +@cindex @code{schur} +@item realschur schur(real[][] a) +returns a struct @code{realschur} containing a unitary matrix @code{U} and +a quasitriangular matrix @code{T} such that +@code{a=U*T*transpose(U)}; + +@cindex @code{schur} +@item schur schur(pair[][] a) +returns a struct @code{schur} containing a unitary matrix @code{U} and +a triangular matrix @code{T} such that +@code{a=U*T*conj(transpose(U))}; + @cindex @code{dot} @item real dot(real[] a, real[] b) returns the dot product of the vectors @code{a} and @code{b}; @@ -6336,7 +6350,7 @@ External @code{Asymptote} code can be included with @end verbatim @noindent so that @code{latexmk} will recognize when the code is changed. Note that -@code{latemk} requires @code{perl}, available from @url{https://www.perl.org/}. +@code{latexmk} requires @code{perl}, available from @url{https://www.perl.org/}. @cindex @code{width} @cindex @code{height} @@ -8081,7 +8095,7 @@ the indices of the elements in @code{v} that form the vertices of each triangle. Similarly, the arguments @code{n} and @code{ni} contain optional normal data and @code{p} and @code{pi} contain optional pen vertex data. If more than one normal or pen is specified for a vertex, the -last one specified is used. +last one is used. An example of this tessellation facility is given in @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/triangles.html,,triangles}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/triangles.asy,,.asy}}. @cindex @code{thin} @@ -8262,7 +8276,7 @@ The @acronym{PRC} specification is available from external viewer or conversion to an alternate 3D format with the Python @code{pyv3d} library. The @code{V3D} specification and the @code{pyv3d} library are available at -@url{https://gitlab.com/vectorgraphics/v3d}. +@url{https://github.com/vectorgraphics/v3d}. A @code{V3D} file @code{file.v3d} may be imported and viewed by @code{Asymptote} either by specifying @code{file.v3d} on the command line @verbatim @@ -8578,7 +8592,7 @@ by @code{y} in the @math{y} direction, and by @code{z} in the @math{z} direction; @cindex @code{rotate} @item rotate(real angle, triple v) -rotates by @code{angle} in degrees about an axis @code{v} through the origin; +rotates by @code{angle} in degrees about the axis @code{O--v}; @item rotate(real angle, triple u, triple v) rotates by @code{angle} in degrees about the axis @code{u--v}; @item reflect(triple u, triple v, triple w) @@ -8985,6 +8999,22 @@ An optional splinetype @code{Spline} may be specified. The boolean array or function @code{cond} can be used to control which surface mesh cells are actually drawn (by default all mesh cells over @code{box(a,b)} are drawn). + +@cindex @code{surface} +One can also construct the surface generated by rotating a path @code{g} +between @code{angle1} to @code{angle2} (in degrees) sampled @code{n} +times about the line @code{c--c+axis}: +@verbatim +surface surface(triple c, path3 g, triple axis, int n=nslice, + real angle1=0, real angle2=360, pen color(int i, real j)=null); +@end verbatim +@noindent +@cindex @code{color} +The optional argument @code{color(int i, real j)} can be used to override the +surface color at the point obtained by rotating vertex @code{i} by +angle @code{j} (in degrees). + +@noindent Surface lighting is illustrated in the example files @code{@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.html,,parametricsurface}@uref{https://asymptote.sourceforge.io/gallery/3Dwebgl/parametricsurface.asy,,.asy}} and @code{@uref{https://asymptote.sourceforge.io/gallery/3D graphs/sinc.html,,sinc}@uref{https://asymptote.sourceforge.io/gallery/3D graphs/sinc.asy,,.asy}}. Lighting can be disabled by setting @code{light=nolight}, as in this example @@ -9547,7 +9577,7 @@ To produce @acronym{SVG} output, you will need @code{dvisvgm} (version You might need to adjust the configuration variable @code{libgs} to point to the location of your @code{Ghostscript} library @code{libgs.so} (or to an empty string, depending on how -@code{dvisvgm} was configured). The 2.10 version (or later) of +@code{dvisvgm} was configured). The 2.13.1 version (or later) of @code{dvisvgm} can display @acronym{SVG} output (used by the @code{xasy} editor) for embedded @acronym{EPS}, @acronym{PDF}, @acronym{PNG}, and @acronym{JPEG} images included with the @@ -9788,10 +9818,11 @@ and the @code{librsvg} package on @code{MacOS X}; under @url{https://sourceforge.net/projects/tumagcc/files/rsvg-convert-2.40.20.7z} +@cindex @code{dvisvgmMultipleFiles} Deconstruction of a picture into its components is fastest when using -the @code{LaTeX} TeX engine. One can speed up deconstruction for -other TeX engines using the 2.13.1 version or later of @code{dvisvgm} -and setting @code{dvisvgmMultipleFiles=true;} in the @code{Asymptote} configuration file (@pxref{configuration file}). +the @code{LaTeX} TeX engine. The default setting +@code{dvisvgmMultipleFiles=true} speeds up deconstruction +under @acronym{PDF} TeX engines. @node GUI usage, , GUI installation, GUI @section GUI usage diff --git a/graphics/asymptote/doc/png/asymptote.info b/graphics/asymptote/doc/png/asymptote.info index 2a51ec3389..7bb896355d 100644 --- a/graphics/asymptote/doc/png/asymptote.info +++ b/graphics/asymptote/doc/png/asymptote.info @@ -1,7 +1,7 @@ This is asymptote.info, produced by makeinfo version 6.8 from asymptote.texi. -This file documents 'Asymptote', version 2.80. +This file documents 'Asymptote', version 2.82. <https://asymptote.sourceforge.io> @@ -22,7 +22,7 @@ File: asymptote.info, Node: Top, Next: Description, Prev: (dir), Up: (dir) Asymptote ********* -This file documents 'Asymptote', version 2.80. +This file documents 'Asymptote', version 2.82. <https://asymptote.sourceforge.io> @@ -617,7 +617,7 @@ setlocal errorformat=%f:\ %l.%c:\ %m Syntax highlighting support for the KDE editor 'Kate' can be enabled by running 'asy-kate.sh' in the '/usr/local/share/asymptote' directory and putting the generated 'asymptote.xml' file in -'~/.kde/share/apps/katepart/syntax/'. +'~/.local/share/org.kde.syntax-highlighting/syntax/'. File: asymptote.info, Node: Git, Next: Uninstall, Prev: Editing modes, Up: Installation @@ -3330,12 +3330,12 @@ an error. The function 'bool alias(T,T)' checks to see if two structure references refer to the same instance of the structure (or both to -'null'). In example at the beginning of this section, 'alias(foo,bar)' -would return true, but 'alias(foo,new T)' would return false, as 'new T' -creates a new instance of the structure 'T'. The boolean operators '==' -and '!=' are by default equivalent to 'alias' and '!alias' respectively, -but may be overwritten for a particular type (for example, to do a deep -comparison). +'null'). In the example at the beginning of this section, +'alias(foo,bar)' would return true, but 'alias(foo,new T)' would return +false, as 'new T' creates a new instance of the structure 'T'. The +boolean operators '==' and '!=' are by default equivalent to 'alias' and +'!alias' respectively, but may be overwritten for a particular type (for +example, to do a deep comparison). Here is a simple example that illustrates the use of structures: struct S { @@ -4297,6 +4297,14 @@ of type 'T[]'. returns the unnormalized three-dimensional Fourier transform of 'a' using the given 'sign'; +'realschur schur(real[][] a)' + returns a struct 'realschur' containing a unitary matrix 'U' and a + quasitriangular matrix 'T' such that 'a=U*T*transpose(U)'; + +'schur schur(pair[][] a)' + returns a struct 'schur' containing a unitary matrix 'U' and a + triangular matrix 'T' such that 'a=U*T*conj(transpose(U))'; + 'real dot(real[] a, real[] b)' returns the dot product of the vectors 'a' and 'b'; @@ -4892,7 +4900,7 @@ in a file 'latexmkrc' in the same directory. External 'Asymptote' code can be included with \asyinclude[<options>]{<filename.asy>} so that 'latexmk' will recognize when the code is changed. Note that -'latemk' requires 'perl', available from <https://www.perl.org/>. +'latexmk' requires 'perl', available from <https://www.perl.org/>. One can specify 'width', 'height', 'keepAspect', 'viewportwidth', 'viewportheight', 'attach', and 'inline'. 'keyval'-style options to the @@ -6990,8 +6998,8 @@ while the array 'vi' contains integer arrays of length 3 containing the indices of the elements in 'v' that form the vertices of each triangle. Similarly, the arguments 'n' and 'ni' contain optional normal data and 'p' and 'pi' contain optional pen vertex data. If more than one normal -or pen is specified for a vertex, the last one specified is used. An -example of this tessellation facility is given in 'triangles.asy'. +or pen is specified for a vertex, the last one is used. An example of +this tessellation facility is given in 'triangles.asy'. Arbitrary thick three-dimensional curves and line caps (which the 'OpenGL' standard does not require implementations to provide) are @@ -7130,7 +7138,7 @@ There are six choices for viewing 3D 'Asymptote' output: 5. Output a 'V3D' portable compressed binary file for viewing with an external viewer or conversion to an alternate 3D format with the Python 'pyv3d' library. The 'V3D' specification and the 'pyv3d' - library are available at <https://gitlab.com/vectorgraphics/v3d>. + library are available at <https://github.com/vectorgraphics/v3d>. A 'V3D' file 'file.v3d' may be imported and viewed by 'Asymptote' either by specifying 'file.v3d' on the command line asy -V file.v3d @@ -7339,7 +7347,7 @@ following built-in transform3 types (the identity transformation is scales by 'x' in the x direction, by 'y' in the y direction, and by 'z' in the z direction; 'rotate(real angle, triple v)' - rotates by 'angle' in degrees about an axis 'v' through the origin; + rotates by 'angle' in degrees about the axis 'O--v'; 'rotate(real angle, triple u, triple v)' rotates by 'angle' in degrees about the axis 'u--v'; 'reflect(triple u, triple v, triple w)' @@ -7662,10 +7670,20 @@ over the parameter space 'box(a,b)', as illustrated in the example 'parametricsurface.asy'. An optional splinetype 'Spline' may be specified. The boolean array or function 'cond' can be used to control which surface mesh cells are actually drawn (by default all mesh cells -over 'box(a,b)' are drawn). Surface lighting is illustrated in the -example files 'parametricsurface.asy' and 'sinc.asy'. Lighting can be -disabled by setting 'light=nolight', as in this example of a Gaussian -surface: +over 'box(a,b)' are drawn). + + One can also construct the surface generated by rotating a path 'g' +between 'angle1' to 'angle2' (in degrees) sampled 'n' times about the +line 'c--c+axis': +surface surface(triple c, path3 g, triple axis, int n=nslice, + real angle1=0, real angle2=360, pen color(int i, real j)=null); +The optional argument 'color(int i, real j)' can be used to override the +surface color at the point obtained by rotating vertex 'i' by angle 'j' +(in degrees). + +Surface lighting is illustrated in the example files +'parametricsurface.asy' and 'sinc.asy'. Lighting can be disabled by +setting 'light=nolight', as in this example of a Gaussian surface: import graph3; size(200,0); @@ -8266,10 +8284,11 @@ Usage: ../asy [options] [file ...] Options (negate by replacing - with -no): +-GPUblockSize n Compute shader block size [8] -GPUcompress Compress GPU transparent fragment counts [false] -GPUindexing Compute indexing partial sums on GPU [true] -GPUinterlock Use fragment shader interlock [true] --GPUlocalSize n Compute shader local size [16] +-GPUlocalSize n Compute shader local size [256] -V,-View View output; command-line only -absolute Use absolute WebGL dimensions [false] -a,-align C|B|T|Z Center, Bottom, Top, or Zero page alignment [C] @@ -8294,7 +8313,7 @@ Options (negate by replacing - with -no): -devicepixelratio n Ratio of physical to logical pixels [1] -digits n Default output file precision [7] -divisor n Garbage collect using purge(divisor=n) [2] --dvisvgmMultipleFiles dvisvgm supports multiple files [false] +-dvisvgmMultipleFiles dvisvgm supports multiple files [true] -embed Embed rendered preview image [true] -exitonEOF Exit interactive mode on EOF [true] -fitscreen Fit rendered image to screen [true] @@ -8432,9 +8451,10 @@ using the '-f' option (or 'outformat' setting). later) from <https://dvisvgm.de>. You might need to adjust the configuration variable 'libgs' to point to the location of your 'Ghostscript' library 'libgs.so' (or to an empty string, depending on -how 'dvisvgm' was configured). The 2.10 version (or later) of 'dvisvgm' -can display SVG output (used by the 'xasy' editor) for embedded EPS, -PDF, PNG, and JPEG images included with the 'graphic()' function. +how 'dvisvgm' was configured). The 2.13.1 version (or later) of +'dvisvgm' can display SVG output (used by the 'xasy' editor) for +embedded EPS, PDF, PNG, and JPEG images included with the 'graphic()' +function. 'Asymptote' can also produce any output format supported by the 'ImageMagick' 'convert' program (version 6.3.5 or later recommended; an @@ -8620,10 +8640,8 @@ available as <https://sourceforge.net/projects/tumagcc/files/rsvg-convert-2.40.20.7z> Deconstruction of a picture into its components is fastest when using -the 'LaTeX' TeX engine. One can speed up deconstruction for other TeX -engines using the 2.13.1 version or later of 'dvisvgm' and setting -'dvisvgmMultipleFiles=true;' in the 'Asymptote' configuration file -(*note configuration file::). +the 'LaTeX' TeX engine. The default setting 'dvisvgmMultipleFiles=true' +speeds up deconstruction under PDF TeX engines. File: asymptote.info, Node: GUI usage, Prev: GUI installation, Up: GUI @@ -8933,9 +8951,9 @@ Index * ---: Bezier curves. (line 84) * -=: Self & prefix operators. (line 6) -* -c: Options. (line 207) -* -l: Options. (line 226) -* -u: Options. (line 217) +* -c: Options. (line 209) +* -l: Options. (line 228) +* -u: Options. (line 219) * -V: Configuring. (line 6) * -V <1>: Drawing in batch mode. (line 16) @@ -9014,8 +9032,8 @@ Index * alias: Structures. (line 62) * alias <1>: Arrays. (line 183) * Align: label. (line 12) -* aligndir: Options. (line 199) -* all: Arrays. (line 342) +* aligndir: Options. (line 201) +* all: Arrays. (line 350) * Allow: Pens. (line 363) * and: Bezier curves. (line 56) * AND: Arithmetic & logical. @@ -9028,7 +9046,7 @@ Index * animation <1>: animation. (line 6) * annotate: annotate. (line 6) * antialias: three. (line 261) -* antialias <1>: Options. (line 169) +* antialias <1>: Options. (line 170) * append: Files. (line 38) * append <1>: Arrays. (line 39) * arc: Paths and guides. (line 24) @@ -9082,7 +9100,7 @@ Index * Asymptote Web Application: Description. (line 6) * asymptote.sty: LaTeX usage. (line 6) * asymptote.xml: Editing modes. (line 48) -* ASYMPTOTE_CONFIG: Options. (line 140) +* ASYMPTOTE_CONFIG: Options. (line 141) * atan: Mathematical functions. (line 6) * aTan: Mathematical functions. @@ -9097,7 +9115,7 @@ Index * attach <1>: LaTeX usage. (line 50) * attach <2>: graph. (line 406) * autoadjust: three. (line 418) -* autoimport: Options. (line 136) +* autoimport: Options. (line 137) * automatic scaling: graph. (line 710) * automatic scaling <1>: graph. (line 710) * axialshade: fill. (line 43) @@ -9236,13 +9254,14 @@ Index * cmyk: Pens. (line 38) * colatitude: Data types. (line 159) * color: Pens. (line 23) +* color <1>: graph3. (line 133) * coloredNodes: tube. (line 25) * coloredpath: tube. (line 18) * coloredSegments: tube. (line 25) * colorless: Pens. (line 57) * colors: Pens. (line 54) * comma: Files. (line 65) -* comma-separated-value mode: Arrays. (line 374) +* comma-separated-value mode: Arrays. (line 382) * command-line interface: Command-Line Interface. (line 6) * command-line options: Configuring. (line 91) @@ -9257,13 +9276,13 @@ Index * conditional <1>: Arithmetic & logical. (line 61) * config: Configuring. (line 74) -* config <1>: Options. (line 140) +* config <1>: Options. (line 141) * configuration file: Configuring. (line 20) -* configuration file <1>: Options. (line 140) +* configuration file <1>: Options. (line 141) * configuring: Configuring. (line 6) * conj: Data types. (line 62) * constructors: Structures. (line 91) -* context: Options. (line 169) +* context: Options. (line 170) * continue: Programming. (line 48) * continue <1>: Debugger. (line 31) * contour: contour. (line 6) @@ -9274,8 +9293,8 @@ Index * convert: Configuring. (line 74) * convert <1>: Files. (line 159) * convert <2>: animation. (line 6) -* convert <3>: Options. (line 169) -* convertOptions: Options. (line 155) +* convert <3>: Options. (line 170) +* convertOptions: Options. (line 156) * Coons shading: fill. (line 78) * copy: Arrays. (line 176) * cos: Mathematical functions. @@ -9292,10 +9311,10 @@ Index * cross <2>: graph. (line 480) * crossframe: markers. (line 22) * crosshatch: Pens. (line 302) -* csv: Arrays. (line 374) +* csv: Arrays. (line 382) * CTZ: Arithmetic & logical. (line 68) -* cubicroots: Arrays. (line 331) +* cubicroots: Arrays. (line 339) * curl: Bezier curves. (line 66) * curl <1>: three. (line 6) * curlSpecifier: Paths and guides. (line 408) @@ -9346,11 +9365,11 @@ Index * delete <1>: Arrays. (line 39) * description: Description. (line 6) * devicepixelratio: three. (line 184) -* diagonal: Arrays. (line 316) +* diagonal: Arrays. (line 324) * diamond: flowchart. (line 54) * diffuse: three. (line 76) * diffusepen: three. (line 66) -* dimension: Arrays. (line 379) +* dimension: Arrays. (line 387) * dir: Search paths. (line 9) * dir <1>: Data types. (line 90) * dir <2>: Data types. (line 181) @@ -9367,8 +9386,8 @@ Index * dot: draw. (line 83) * dot <1>: Data types. (line 103) * dot <2>: Data types. (line 194) -* dot <3>: Arrays. (line 271) -* dot <4>: Arrays. (line 274) +* dot <3>: Arrays. (line 279) +* dot <4>: Arrays. (line 282) * DotMargin: draw. (line 42) * DotMargin3: three. (line 638) * DotMargins: draw. (line 42) @@ -9387,10 +9406,11 @@ Index * drawline: math. (line 9) * drawtree: drawtree. (line 6) * dvips: Configuring. (line 74) -* dvipsOptions: Options. (line 155) +* dvipsOptions: Options. (line 156) * dvisvgm: Configuring. (line 74) -* dvisvgm <1>: Options. (line 174) -* dvisvgmOptions: Options. (line 155) +* dvisvgm <1>: Options. (line 175) +* dvisvgmMultipleFiles: GUI installation. (line 20) +* dvisvgmOptions: Options. (line 156) * E: Labels. (line 18) * E <1>: Mathematical functions. (line 48) @@ -9428,11 +9448,11 @@ Index (line 25) * environment variables: Configuring. (line 95) * eof: Files. (line 97) -* eof <1>: Arrays. (line 356) +* eof <1>: Arrays. (line 364) * eol: Files. (line 97) -* eol <1>: Arrays. (line 356) +* eol <1>: Arrays. (line 364) * EPS: label. (line 78) -* EPS <1>: Options. (line 169) +* EPS <1>: Options. (line 170) * erase: Drawing in interactive mode. (line 11) * erase <1>: Data types. (line 257) @@ -9523,7 +9543,7 @@ Index * fontsize: Pens. (line 192) * for: Programming. (line 26) * format: Data types. (line 290) -* format <1>: Options. (line 169) +* format <1>: Options. (line 170) * forum: Help. (line 6) * frame: Frames and pictures. (line 7) @@ -9543,6 +9563,7 @@ Index (line 39) * geometry: geometry. (line 6) * getc: Files. (line 32) +* getint: Files. (line 122) * getpair: Files. (line 122) * getreal: Files. (line 122) * getstring: Files. (line 122) @@ -9551,7 +9572,7 @@ Index * globalwrite: Files. (line 40) * globalwrite <1>: Files. (line 154) * glOptions: three. (line 261) -* glOptions <1>: Options. (line 155) +* glOptions <1>: Options. (line 156) * GNU Scientific Library: Mathematical functions. (line 48) * gouraudshade: fill. (line 63) @@ -9560,7 +9581,7 @@ Index * graph: graph. (line 6) * graph3: graph3. (line 6) * graphic: label. (line 78) -* graphic <1>: Options. (line 174) +* graphic <1>: Options. (line 175) * graphical user interface: GUI. (line 6) * graphwithderiv: graph. (line 670) * gray: Pens. (line 25) @@ -9574,7 +9595,7 @@ Index (line 62) * gsl: Mathematical functions. (line 48) -* gsOptions: Options. (line 155) +* gsOptions: Options. (line 156) * GUI: GUI. (line 6) * GUI installation: GUI installation. (line 6) * GUI usage: GUI usage. (line 6) @@ -9604,8 +9625,8 @@ Index * HTML5: three. (line 233) * htmlviewer: Configuring. (line 20) * htmlviewer <1>: Configuring. (line 43) -* htmlviewerOptions: Options. (line 155) -* hyperrefOptions: Options. (line 155) +* htmlviewerOptions: Options. (line 156) +* hyperrefOptions: Options. (line 156) * hypot: Mathematical functions. (line 6) * I: Mathematical functions. @@ -9615,7 +9636,7 @@ Index * identity: Transforms. (line 24) * identity <1>: Mathematical functions. (line 6) -* identity <2>: Arrays. (line 313) +* identity <2>: Arrays. (line 321) * identity4: three. (line 494) * if: Programming. (line 26) * IgnoreAspect: Frames and pictures. @@ -9625,7 +9646,7 @@ Index * image-based lighting: three. (line 104) * ImageMagick: Configuring. (line 74) * ImageMagick <1>: animation. (line 6) -* ImageMagick <2>: Options. (line 169) +* ImageMagick <2>: Options. (line 170) * images: palette. (line 6) * implicit casts: Casts. (line 6) * implicit linear solver: MetaPost. (line 10) @@ -9689,7 +9710,7 @@ Index * intMax: Data types. (line 30) * intMin: Data types. (line 30) * inverse: Transforms. (line 16) -* inverse <1>: Arrays. (line 319) +* inverse <1>: Arrays. (line 327) * invert: three. (line 484) * invisible: Pens. (line 43) * isnan: Data types. (line 35) @@ -9734,7 +9755,7 @@ Index (line 6) * lastcut: Paths and guides. (line 266) * lasy-mode: Editing modes. (line 6) -* latex: Options. (line 169) +* latex: Options. (line 170) * LaTeX NFSS fonts: Pens. (line 206) * LaTeX usage: LaTeX usage. (line 6) * latexmk: LaTeX usage. (line 30) @@ -9765,16 +9786,16 @@ Index * lexorder: math. (line 63) * lexorder <1>: math. (line 66) * libcurl: Import. (line 94) -* libgs: Options. (line 174) +* libgs: Options. (line 175) * libm routines: Mathematical functions. (line 6) * libsigsegv: Functions. (line 100) * libsigsegv <1>: Help. (line 27) * light: three. (line 76) * limits: graph. (line 639) -* line: Arrays. (line 356) -* line <1>: Arrays. (line 360) -* line mode: Arrays. (line 356) +* line: Arrays. (line 364) +* line <1>: Arrays. (line 368) +* line mode: Arrays. (line 364) * Linear: graph. (line 710) * linecap: Pens. (line 139) * linejoin: Pens. (line 149) @@ -9800,8 +9821,8 @@ Index * loop: Programming. (line 26) * LSP: Language server protocol. (line 6) -* lualatex: Options. (line 169) -* luatex: Options. (line 169) +* lualatex: Options. (line 170) +* luatex: Options. (line 170) * MacOS X binary distributions: MacOS X binary distributions. (line 6) * MacOS X configuration: Compiling from UNIX source. @@ -9907,7 +9928,7 @@ Index * None <1>: draw. (line 26) * none: Files. (line 65) * normal: three. (line 542) -* nosafe: Options. (line 194) +* nosafe: Options. (line 196) * NOT: Arithmetic & logical. (line 68) * notaknot: graph. (line 36) @@ -9928,7 +9949,7 @@ Index * obliqueZ: three. (line 378) * ode: ode. (line 6) * offset: Pens. (line 123) -* offset <1>: Options. (line 199) +* offset <1>: Options. (line 201) * OmitTick: graph. (line 223) * OmitTickInterval: graph. (line 223) * OmitTickIntervals: graph. (line 223) @@ -9960,7 +9981,7 @@ Index * outprefix: Frames and pictures. (line 91) * output: Files. (line 38) -* output <1>: Options. (line 169) +* output <1>: Options. (line 170) * OutTicks: graph3. (line 35) * overloading functions: Functions. (line 55) * overwrite: Pens. (line 360) @@ -9993,11 +10014,11 @@ Index * patterns: Pens. (line 271) * patterns <1>: patterns. (line 6) * PBR: three. (line 74) -* PDF: Options. (line 169) -* pdflatex: Options. (line 169) -* pdfreloadOptions: Options. (line 155) +* PDF: Options. (line 170) +* pdflatex: Options. (line 170) +* pdfreloadOptions: Options. (line 156) * pdfviewer: Configuring. (line 20) -* pdfviewerOptions: Options. (line 155) +* pdfviewerOptions: Options. (line 156) * pen: Pens. (line 6) * PenMargin: draw. (line 42) * PenMargin2: three. (line 638) @@ -10054,13 +10075,13 @@ Index * pstoedit: PostScript to Asymptote. (line 6) * psviewer: Configuring. (line 20) -* psviewerOptions: Options. (line 155) +* psviewerOptions: Options. (line 156) * pt: Figure size. (line 18) * public: Structures. (line 6) * push: Arrays. (line 39) * Python usage: Interactive mode. (line 72) -* quadraticroots: Arrays. (line 322) -* quadraticroots <1>: Arrays. (line 327) +* quadraticroots: Arrays. (line 330) +* quadraticroots <1>: Arrays. (line 335) * quarticroots: math. (line 22) * quick reference: Description. (line 92) * quit: Drawing in interactive mode. @@ -10084,9 +10105,9 @@ Index (line 39) * randMax: Mathematical functions. (line 39) -* read: Arrays. (line 396) +* read: Arrays. (line 404) * reading: Files. (line 12) -* reading string arrays: Arrays. (line 366) +* reading string arrays: Arrays. (line 374) * readline: Files. (line 139) * real: Data types. (line 35) * realDigits: Data types. (line 35) @@ -10094,6 +10115,7 @@ Index * realMax: Data types. (line 35) * realMin: Data types. (line 35) * realmult: Data types. (line 100) +* realschur: Arrays. (line 271) * rectangle: flowchart. (line 34) * recursion: Functions. (line 100) * reference: Description. (line 92) @@ -10107,7 +10129,7 @@ Index * rename: Files. (line 156) * render: three. (line 46) * render <1>: three. (line 184) -* render <2>: Options. (line 169) +* render <2>: Options. (line 170) * replace: Data types. (line 270) * resetdefaultpen: Pens. (line 387) * rest arguments: Rest arguments. (line 6) @@ -10146,7 +10168,7 @@ Index * runtime imports: Import. (line 102) * Russian: Pens. (line 238) * S: Labels. (line 18) -* safe: Options. (line 194) +* safe: Options. (line 196) * save: Frames and pictures. (line 288) * saveline: Files. (line 139) @@ -10159,6 +10181,8 @@ Index * scale <4>: three. (line 509) * scale3: three. (line 507) * scaled graph: graph. (line 690) +* schur: Arrays. (line 271) +* schur <1>: Arrays. (line 275) * scientific graph: graph. (line 387) * scroll: Files. (line 113) * search: Arrays. (line 166) @@ -10178,7 +10202,7 @@ Index (line 6) * sequence: Arrays. (line 118) * settings: Configuring. (line 20) -* settings <1>: Options. (line 140) +* settings <1>: Options. (line 141) * sgn: Mathematical functions. (line 26) * shading: fill. (line 32) @@ -10222,7 +10246,7 @@ Index * size <4>: Frames and pictures. (line 74) * size <5>: three. (line 556) -* size <6>: Options. (line 169) +* size <6>: Options. (line 170) * size3: three. (line 320) * Slant: label. (line 42) * slant: Transforms. (line 38) @@ -10239,8 +10263,8 @@ Index (line 48) * solid: Pens. (line 102) * solids: solids. (line 6) -* solve: Arrays. (line 291) -* solve <1>: Arrays. (line 307) +* solve: Arrays. (line 299) +* solve <1>: Arrays. (line 315) * sort: Arrays. (line 186) * sort <1>: Arrays. (line 190) * sort <2>: Arrays. (line 205) @@ -10292,9 +10316,10 @@ Index * surface <2>: three. (line 128) * surface <3>: three. (line 142) * surface <4>: graph3. (line 99) -* SVG: Options. (line 174) +* surface <5>: graph3. (line 128) +* SVG: Options. (line 175) * system: Data types. (line 354) -* system <1>: Options. (line 194) +* system <1>: Options. (line 196) * syzygy: syzygy. (line 6) * tab: Files. (line 65) * tab completion: Drawing in interactive mode. @@ -10315,7 +10340,7 @@ Index * tessellation: three. (line 154) * tex: Frames and pictures. (line 305) -* tex <1>: Options. (line 169) +* tex <1>: Options. (line 170) * TeX fonts: Pens. (line 213) * TeX string: Data types. (line 208) * texcommand: Configuring. (line 74) @@ -10366,7 +10391,7 @@ Index * triangle: geometry. (line 6) * triangles: three. (line 154) * triangulate: contour. (line 192) -* tridiagonal: Arrays. (line 278) +* tridiagonal: Arrays. (line 286) * trigonometric integrals: Mathematical functions. (line 48) * triple: Data types. (line 137) @@ -10427,8 +10452,8 @@ Index (line 6) * vectorfield: graph. (line 1023) * vectorfield <1>: graph. (line 1062) -* vectorfield3: graph3. (line 157) -* vectorization: Arrays. (line 335) +* vectorfield3: graph3. (line 167) +* vectorization: Arrays. (line 343) * verbatim: Frames and pictures. (line 297) * vertex-dependent colors: three. (line 119) @@ -10449,17 +10474,17 @@ Index * wheel mouse: GUI. (line 6) * while: Programming. (line 48) * White: three. (line 76) -* white-space string delimiter mode: Arrays. (line 366) +* white-space string delimiter mode: Arrays. (line 374) * width: LaTeX usage. (line 50) * windingnumber: Paths and guides. (line 283) -* word: Arrays. (line 366) +* word: Arrays. (line 374) * write: Files. (line 57) -* write <1>: Arrays. (line 405) +* write <1>: Arrays. (line 413) * X: three. (line 335) * xasy: GUI. (line 6) * xaxis3: graph3. (line 7) * xdr: Files. (line 80) -* xelatex: Options. (line 169) +* xelatex: Options. (line 170) * XEquals: graph. (line 265) * xequals: graph. (line 278) * xlimits: graph. (line 639) @@ -10531,143 +10556,143 @@ Node: Configuring15529 Node: Search paths20144 Node: Compiling from UNIX source21152 Node: Editing modes24303 -Node: Git26725 -Node: Uninstall27232 -Node: Tutorial27578 -Node: Drawing in batch mode28425 -Node: Drawing in interactive mode29301 -Node: Figure size30333 -Node: Labels31928 -Node: Paths32756 -Ref: unitcircle33372 -Node: Drawing commands35313 -Node: draw37121 -Ref: arrows38303 -Node: fill43818 -Ref: gradient shading44864 -Node: clip49478 -Node: label50227 -Ref: Label50827 -Node: Bezier curves56684 -Node: Programming60584 -Ref: array iteration62337 -Node: Data types62504 -Ref: format73272 -Node: Paths and guides77718 -Ref: circle77972 -Ref: extension87672 -Node: Pens94482 -Ref: fillrule102173 -Ref: basealign103077 -Ref: transparency106759 -Ref: makepen110353 -Ref: overwrite111237 -Node: Transforms112451 -Node: Frames and pictures114390 -Ref: envelope115548 -Ref: size116641 -Ref: unitsize117628 -Ref: shipout118701 -Ref: filltype121052 -Ref: add124465 -Ref: add about125407 -Ref: tex128437 -Node: Files129332 -Ref: cd130389 -Ref: scroll135291 -Node: Variable initializers138209 -Node: Structures140926 -Node: Operators148499 -Node: Arithmetic & logical148813 -Node: Self & prefix operators151183 -Node: User-defined operators151977 -Node: Implicit scaling152890 -Node: Functions153453 -Ref: stack overflow156570 -Node: Default arguments156852 -Node: Named arguments157608 -Node: Rest arguments160178 -Node: Mathematical functions163299 -Node: Arrays167956 -Ref: sort175395 -Ref: tridiagonal178306 -Ref: solve179537 -Node: Slices183677 -Node: Casts187585 -Node: Import189855 -Node: Static195425 -Node: LaTeX usage198311 -Node: Base modules204826 -Node: plain207303 -Node: simplex207977 -Node: math208250 -Node: interpolate210917 -Node: geometry211196 -Node: trembling211876 -Node: stats212145 -Node: patterns212404 -Node: markers212639 -Node: map214497 -Node: tree214921 -Node: binarytree215101 -Node: drawtree215768 -Node: syzygy215969 -Node: feynman216243 -Node: roundedpath216517 -Node: animation216799 -Ref: animate217220 -Node: embed218332 -Node: slide219286 -Node: MetaPost219617 -Node: babel220333 -Node: labelpath220565 -Node: labelpath3221385 -Node: annotate221696 -Node: CAD222166 -Node: graph222476 -Ref: ticks229635 -Ref: pathmarkers243357 -Ref: marker243827 -Ref: markuniform244181 -Ref: errorbars246040 -Ref: automatic scaling251169 -Node: palette262879 -Ref: images262997 -Ref: image267293 -Ref: logimage267814 -Ref: penimage268920 -Ref: penfunctionimage269183 -Node: three269955 -Ref: PostScript3D300255 -Node: obj301993 -Node: graph3302242 -Ref: GaussianSurface307524 -Node: grid3308674 -Node: solids309502 -Node: tube310494 -Node: flowchart312766 -Node: contour317409 -Node: contour3323917 -Node: smoothcontour3324229 -Node: slopefield325948 -Node: ode327437 -Node: Options327694 -Ref: configuration file335375 -Ref: settings335375 -Ref: texengines336639 -Ref: convert336639 -Node: Interactive mode340082 -Ref: history342231 -Node: GUI343534 -Node: GUI installation344084 -Node: GUI usage345126 -Node: Command-Line Interface346189 -Node: Language server protocol347631 -Node: PostScript to Asymptote349056 -Node: Help349834 -Node: Debugger351508 -Node: Credits353264 -Node: Index354489 +Node: Git26741 +Node: Uninstall27248 +Node: Tutorial27594 +Node: Drawing in batch mode28441 +Node: Drawing in interactive mode29317 +Node: Figure size30349 +Node: Labels31944 +Node: Paths32772 +Ref: unitcircle33388 +Node: Drawing commands35329 +Node: draw37137 +Ref: arrows38319 +Node: fill43834 +Ref: gradient shading44880 +Node: clip49494 +Node: label50243 +Ref: Label50843 +Node: Bezier curves56700 +Node: Programming60600 +Ref: array iteration62353 +Node: Data types62520 +Ref: format73288 +Node: Paths and guides77734 +Ref: circle77988 +Ref: extension87688 +Node: Pens94498 +Ref: fillrule102189 +Ref: basealign103093 +Ref: transparency106775 +Ref: makepen110369 +Ref: overwrite111253 +Node: Transforms112467 +Node: Frames and pictures114406 +Ref: envelope115564 +Ref: size116657 +Ref: unitsize117644 +Ref: shipout118717 +Ref: filltype121068 +Ref: add124481 +Ref: add about125423 +Ref: tex128453 +Node: Files129348 +Ref: cd130405 +Ref: scroll135307 +Node: Variable initializers138225 +Node: Structures140942 +Node: Operators148519 +Node: Arithmetic & logical148833 +Node: Self & prefix operators151203 +Node: User-defined operators151997 +Node: Implicit scaling152910 +Node: Functions153473 +Ref: stack overflow156590 +Node: Default arguments156872 +Node: Named arguments157628 +Node: Rest arguments160198 +Node: Mathematical functions163319 +Node: Arrays167976 +Ref: sort175415 +Ref: tridiagonal178653 +Ref: solve179884 +Node: Slices184024 +Node: Casts187932 +Node: Import190202 +Node: Static195772 +Node: LaTeX usage198658 +Node: Base modules205174 +Node: plain207651 +Node: simplex208325 +Node: math208598 +Node: interpolate211265 +Node: geometry211544 +Node: trembling212224 +Node: stats212493 +Node: patterns212752 +Node: markers212987 +Node: map214845 +Node: tree215269 +Node: binarytree215449 +Node: drawtree216116 +Node: syzygy216317 +Node: feynman216591 +Node: roundedpath216865 +Node: animation217147 +Ref: animate217568 +Node: embed218680 +Node: slide219634 +Node: MetaPost219965 +Node: babel220681 +Node: labelpath220913 +Node: labelpath3221733 +Node: annotate222044 +Node: CAD222514 +Node: graph222824 +Ref: ticks229983 +Ref: pathmarkers243705 +Ref: marker244175 +Ref: markuniform244529 +Ref: errorbars246388 +Ref: automatic scaling251517 +Node: palette263227 +Ref: images263345 +Ref: image267641 +Ref: logimage268162 +Ref: penimage269268 +Ref: penfunctionimage269531 +Node: three270303 +Ref: PostScript3D300578 +Node: obj302316 +Node: graph3302565 +Ref: GaussianSurface308308 +Node: grid3309458 +Node: solids310286 +Node: tube311278 +Node: flowchart313550 +Node: contour318193 +Node: contour3324701 +Node: smoothcontour3325013 +Node: slopefield326732 +Node: ode328221 +Node: Options328478 +Ref: configuration file336212 +Ref: settings336212 +Ref: texengines337476 +Ref: convert337476 +Node: Interactive mode340921 +Ref: history343070 +Node: GUI344373 +Node: GUI installation344923 +Node: GUI usage345851 +Node: Command-Line Interface346914 +Node: Language server protocol348356 +Node: PostScript to Asymptote349781 +Node: Help350559 +Node: Debugger352233 +Node: Credits353989 +Node: Index355214 End Tag Table diff --git a/graphics/asymptote/drawpath3.cc b/graphics/asymptote/drawpath3.cc index 20543e2eda..d512c62a7c 100644 --- a/graphics/asymptote/drawpath3.cc +++ b/graphics/asymptote/drawpath3.cc @@ -50,10 +50,10 @@ bool drawPath3::write(abs3Doutfile *out) setcolors(diffuse,emissive,specular,shininess,metallic,fresnel0,out); if(straight) - out->addCurve(g.point((Int) 0),g.point((Int) 1),Min,Max); + out->addCurve(g.point((Int) 0),g.point((Int) 1)); else out->addCurve(g.point((Int) 0),g.postcontrol((Int) 0), - g.precontrol((Int) 1),g.point((Int) 1),Min,Max); + g.precontrol((Int) 1),g.point((Int) 1)); #endif return true; } @@ -231,7 +231,7 @@ bool drawPixel::write(abs3Doutfile *out) RGBAColour Black(0.0,0.0,0.0,color.A); setcolors(color,color,Black,1.0,0.0,0.04,out); - out->addPixel(v,width,Min,Max); + out->addPixel(v,width); #endif return true; } diff --git a/graphics/asymptote/drawsurface.cc b/graphics/asymptote/drawsurface.cc index ac87bdb586..104b545668 100644 --- a/graphics/asymptote/drawsurface.cc +++ b/graphics/asymptote/drawsurface.cc @@ -118,18 +118,18 @@ void drawBezierPatch::bounds(const double* t, bbox3& b) double c0=cx[0]; double fuzz=Fuzz*run::norm(cx,16); - x=bound(cx,min,b.empty ? c0 : min(c0,b.left),fuzz,maxdepth); - X=bound(cx,max,b.empty ? c0 : max(c0,b.right),fuzz,maxdepth); + x=bound(cx,min,c0,fuzz,maxdepth); + X=bound(cx,max,c0,fuzz,maxdepth); c0=cy[0]; fuzz=Fuzz*run::norm(cy,16); - y=bound(cy,min,b.empty ? c0 : min(c0,b.bottom),fuzz,maxdepth); - Y=bound(cy,max,b.empty ? c0 : max(c0,b.top),fuzz,maxdepth); + y=bound(cy,min,c0,fuzz,maxdepth); + Y=bound(cy,max,c0,fuzz,maxdepth); c0=cz[0]; fuzz=Fuzz*run::norm(cz,16); - z=bound(cz,min,b.empty ? c0 : min(c0,b.near),fuzz,maxdepth); - Z=bound(cz,max,b.empty ? c0 : max(c0,b.far),fuzz,maxdepth); + z=bound(cz,min,c0,fuzz,maxdepth); + Z=bound(cz,max,c0,fuzz,maxdepth); } b.add(x,y,z); @@ -232,7 +232,7 @@ bool drawBezierPatch::write(abs3Doutfile *out) out->precision(digits); if(straight) { triple Controls[]={controls[0],controls[12],controls[15],controls[3]}; - out->addStraightPatch(Controls,Min,Max,colors); + out->addStraightPatch(Controls,colors); } else { double prerender=renderResolution(); if(prerender) { @@ -247,7 +247,7 @@ bool drawBezierPatch::write(abs3Doutfile *out) Min,Max); dt.write(out); } else - out->addPatch(controls,Min,Max,colors); + out->addPatch(controls,colors); } out->precision(getSetting<Int>("digits")); @@ -378,18 +378,18 @@ void drawBezierTriangle::bounds(const double* t, bbox3& b) double c0=cx[0]; double fuzz=Fuzz*run::norm(cx,10); - x=boundtri(cx,min,b.empty ? c0 : min(c0,b.left),fuzz,maxdepth); - X=boundtri(cx,max,b.empty ? c0 : max(c0,b.right),fuzz,maxdepth); + x=boundtri(cx,min,c0,fuzz,maxdepth); + X=boundtri(cx,max,c0,fuzz,maxdepth); c0=cy[0]; fuzz=Fuzz*run::norm(cy,10); - y=boundtri(cy,min,b.empty ? c0 : min(c0,b.bottom),fuzz,maxdepth); - Y=boundtri(cy,max,b.empty ? c0 : max(c0,b.top),fuzz,maxdepth); + y=boundtri(cy,min,c0,fuzz,maxdepth); + Y=boundtri(cy,max,c0,fuzz,maxdepth); c0=cz[0]; fuzz=Fuzz*run::norm(cz,10); - z=boundtri(cz,min,b.empty ? c0 : min(c0,b.near),fuzz,maxdepth); - Z=boundtri(cz,max,b.empty ? c0 : max(c0,b.far),fuzz,maxdepth); + z=boundtri(cz,min,c0,fuzz,maxdepth); + Z=boundtri(cz,max,c0,fuzz,maxdepth); } b.add(x,y,z); @@ -493,7 +493,7 @@ bool drawBezierTriangle::write(abs3Doutfile *out) out->precision(digits); if(straight) { triple Controls[]={controls[0],controls[6],controls[9]}; - out->addStraightBezierTriangle(Controls,Min,Max,colors); + out->addStraightBezierTriangle(Controls,colors); } else { double prerender=renderResolution(); if(prerender) { @@ -508,7 +508,7 @@ bool drawBezierTriangle::write(abs3Doutfile *out) Min,Max); dt.write(out); } else - out->addBezierTriangle(controls,Min,Max,colors); + out->addBezierTriangle(controls,colors); } out->precision(getSetting<Int>("digits")); @@ -911,7 +911,7 @@ bool drawTube::write(abs3Doutfile *out) b.add(T*triple(M.getx(),M.gety(),m.getz())); b.add(T*M); - out->addTube(g,width,b.Min(),b.Max(),core); + out->addTube(g,width,core); #endif return true; @@ -995,7 +995,7 @@ bool drawTriangles::write(abs3Doutfile *out) } else drawElement::centerIndex=0; setcolors(diffuse,emissive,specular,shininess,metallic,fresnel0,out); - out->addTriangles(nP,P,nN,N,nC,C,nI,PI,NI,CI,Min,Max); + out->addTriangles(nP,P,nN,N,nC,C,nI,PI,NI,CI); #endif return true; } diff --git a/graphics/asymptote/examples/AiryDisk.asy b/graphics/asymptote/examples/AiryDisk.asy new file mode 100644 index 0000000000..855abfaa95 --- /dev/null +++ b/graphics/asymptote/examples/AiryDisk.asy @@ -0,0 +1,16 @@ +import graph3; +import gsl; + +size(10cm,15cm,IgnoreAspect); +currentprojection=orthographic(150,50,1); + +real f(pair z) {real r=abs(z); return r == 0 ? 1 : (2.0*J(1,r)/r)^2;} + +real R=15; +surface s=surface(f,(-R,-R),(R,R),100,Spline); + +draw(s,green); + +xaxis3("$x$",Bounds,InTicks); +yaxis3("$y$",Bounds,InTicks); +zaxis3(rotate(90)*"$I(\sqrt{x^2+y^2})$",Bounds,InTicks("$%#.1f$")); diff --git a/graphics/asymptote/exp.cc b/graphics/asymptote/exp.cc index 48a5c000f2..e1ae008bf8 100644 --- a/graphics/asymptote/exp.cc +++ b/graphics/asymptote/exp.cc @@ -849,7 +849,9 @@ application *callExp::resolve(coenv &e, overloaded *o, signature *source, em << "call of function \'" << s; else em << "call with signature \'"; - em << *source << "\' is ambiguous"; + em << *source << "\' is ambiguous:\n\n"; + for(app_list::iterator p=l.begin(); p != l.end(); ++p) + em << *(*p)->getType() << "\n"; } return 0; diff --git a/graphics/asymptote/fileio.h b/graphics/asymptote/fileio.h index d601f176d8..6fcd379ec3 100644 --- a/graphics/asymptote/fileio.h +++ b/graphics/asymptote/fileio.h @@ -56,9 +56,8 @@ inline void openpipeout() int fd=intcast(settings::getSetting<Int>("outpipe")); if(!pipeout && fd >= 0) pipeout=fdopen(fd,"w"); if(!pipeout) { - ostringstream buf; - buf << "Cannot open outpipe " << fd; - reportError(buf); + cerr << "Cannot open outpipe " << fd << endl; + exit(-1); } } diff --git a/graphics/asymptote/glrender.cc b/graphics/asymptote/glrender.cc index 9b60846784..18d72d5c4d 100644 --- a/graphics/asymptote/glrender.cc +++ b/graphics/asymptote/glrender.cc @@ -88,18 +88,21 @@ GLint zeroShader; GLint compressShader; GLint sum1Shader; GLint sum2Shader; +GLint sum2fastShader; GLint sum3Shader; +GLuint fragments; + GLuint offsetBuffer; GLuint indexBuffer; GLuint elementsBuffer; GLuint countBuffer; -GLuint localSumBuffer; GLuint globalSumBuffer; GLuint fragmentBuffer; GLuint depthBuffer; GLuint opaqueBuffer; GLuint opaqueDepthBuffer; +GLuint feedbackBuffer; bool ssbo; bool interlock; @@ -167,11 +170,11 @@ GLint gs2; GLint gs; GLint g; GLuint processors; -GLuint localsize; -GLuint lastlocalsize; -GLint maxgroups; +GLuint localSize; +GLuint blockSize; +GLuint groupSize; +//GLint maxgroups; GLuint maxSize; -GLuint lastSize; bool outlinemode=false; bool ibl=false; @@ -543,30 +546,38 @@ void initComputeShaders() { string sum1=locateFile("shaders/sum1.glsl"); string sum2=locateFile("shaders/sum2.glsl"); + string sum2fast=locateFile("shaders/sum2fast.glsl"); string sum3=locateFile("shaders/sum3.glsl"); - if(sum1.empty() || sum2.empty() || sum3.empty()) + if(sum1.empty() || sum2.empty() || sum2fast.empty() || sum3.empty()) noShaders(); std::vector<ShaderfileModePair> shaders(1); std::vector<std::string> shaderParams; shaders[0]=ShaderfileModePair(sum1.c_str(),GL_COMPUTE_SHADER); - ostringstream s; - s << "LOCAL_SIZE_X " << localsize << "u" << endl; + ostringstream s,s2; + s << "LOCALSIZE " << gl::localSize << "u" << endl; shaderParams.push_back(s.str().c_str()); + s2 << "BLOCKSIZE " << gl::blockSize << "u" << endl; + shaderParams.push_back(s2.str().c_str()); GLuint rc=compileAndLinkShader(shaders,shaderParams,true,false,true); if(rc == 0) { GPUindexing=false; // Compute shaders are unavailable. if(settings::verbose > 2) cout << "No compute shader support" << endl; } else { - glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT,0,&maxgroups); - maxgroups=min(1024,maxgroups/(GLint) (localsize*localsize)); +// glGetIntegeri_v(GL_MAX_COMPUTE_WORK_GROUP_COUNT,0,&maxgroups); +// maxgroups=min(1024,maxgroups/(GLint) (localSize*localSize)); camp::sum1Shader=rc; shaders[0]=ShaderfileModePair(sum2.c_str(),GL_COMPUTE_SHADER); - camp::sum2Shader=compileAndLinkShader(shaders,shaderParams,true,false,true); + camp::sum2Shader=compileAndLinkShader(shaders,shaderParams,true,false, + true); + + shaders[0]=ShaderfileModePair(sum2fast.c_str(),GL_COMPUTE_SHADER); + camp::sum2fastShader=compileAndLinkShader(shaders,shaderParams,true,false, + true); shaders[0]=ShaderfileModePair(sum3.c_str(),GL_COMPUTE_SHADER); camp::sum3Shader=compileAndLinkShader(shaders,shaderParams,true,false, @@ -701,7 +712,7 @@ void initShaders() shaderParams.pop_back(); shaderParams.push_back("GENERAL"); - if(Mode == 2) + if(Mode != 0) shaderParams.push_back("WIREFRAME"); camp::generalShader[0]=compileAndLinkShader(shaders,shaderParams,ssbo, interlock); @@ -717,10 +728,10 @@ void initShaders() if(ssbo) { if(GPUindexing) shaderParams.push_back("GPUINDEXING"); - shaders[0]=ShaderfileModePair(screen.c_str(),GL_VERTEX_SHADER); + shaders[0]=ShaderfileModePair(screen.c_str(),GL_VERTEX_SHADER); shaders[1]=ShaderfileModePair(compress.c_str(),GL_FRAGMENT_SHADER); camp::compressShader=compileAndLinkShader(shaders,shaderParams,ssbo); - if(GPUindexing) + if(GPUindexing) shaderParams.pop_back(); else { shaders[1]=ShaderfileModePair(zero.c_str(),GL_FRAGMENT_SHADER); @@ -736,6 +747,7 @@ void deleteComputeShaders() { glDeleteProgram(camp::sum1Shader); glDeleteProgram(camp::sum2Shader); + glDeleteProgram(camp::sum2fastShader); glDeleteProgram(camp::sum3Shader); } @@ -765,12 +777,11 @@ void deleteShaders() glDeleteProgram(camp::pixelShader); } -void resizeBlendShader() +void resizeBlendShader(uint maxsize) { - gl::maxSize=ceilpow2(gl::maxSize); + gl::maxSize=ceilpow2(maxsize); gl::deleteBlendShader(); gl::initBlendShader(); - gl::lastSize=gl::maxSize; } void setBuffers() @@ -788,10 +799,10 @@ void setBuffers() #ifdef HAVE_SSBO glGenBuffers(1, &camp::offsetBuffer); if(GPUindexing) { - glGenBuffers(1, &camp::localSumBuffer); glGenBuffers(1, &camp::globalSumBuffer); - } else - glGenBuffers(1, &camp::countBuffer); + glGenBuffers(1, &camp::feedbackBuffer); + } + glGenBuffers(1, &camp::countBuffer); if(GPUcompress) { glGenBuffers(1, &camp::indexBuffer); glGenBuffers(1, &camp::elementsBuffer); @@ -2155,7 +2166,7 @@ void glrender(const string& prefix, const picture *pic, const string& format, #if defined(HAVE_COMPUTE_SHADER) && !defined(HAVE_LIBOSMESA) GPUindexing=getSetting<bool>("GPUindexing"); - GPUcompress=NVIDIA() || getSetting<bool>("GPUcompress"); + GPUcompress=getSetting<bool>("GPUcompress"); #else GPUindexing=false; GPUcompress=false; @@ -2164,8 +2175,11 @@ void glrender(const string& prefix, const picture *pic, const string& format, GLint val; glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE,&val); - if(GPUindexing) - lastlocalsize=localsize=getSetting<Int>("GPUlocalSize"); + if(GPUindexing) { + gl::localSize=getSetting<Int>("GPUlocalSize"); + gl::blockSize=getSetting<Int>("GPUblockSize"); + gl::groupSize=gl::localSize*gl::blockSize; + } Maxmaterials=val/sizeof(Material); if(nmaterials > Maxmaterials) nmaterials=Maxmaterials; @@ -2328,108 +2342,108 @@ void compressCount() glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); } -void initPartialSums() +void partialSums(bool readSize=false) { - gl::gs=gl::localsize*gl::g; - gl::gs2=gl::localsize*gl::gs; - gl::processors=gl::localsize*gl::gs2; - GLuint zero=0; - glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::localSumBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER, - (gl::processors+gl::gs2+2)*sizeof(GLuint),NULL, - GL_DYNAMIC_DRAW); - glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R32UI,GL_RED_INTEGER, - GL_UNSIGNED_INT,&zero); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER,2,camp::localSumBuffer); - - glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::globalSumBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER,(gl::gs+1)*sizeof(GLuint),NULL, - GL_DYNAMIC_DRAW); - glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R32UI,GL_RED_INTEGER, - GL_UNSIGNED_INT,&zero); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER,3,camp::globalSumBuffer); -} - -GLuint partialSums(bool readSize=false) -{ - GLuint fragments; - // Compute local partial sums on the GPU + // Compute partial sums on the GPU glUseProgram(sum1Shader); - glUniform1ui(glGetUniformLocation(sum1Shader,"elements"),gl::elements); - - glDispatchCompute(gl::gs2,1,1); - - glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT); - - glUseProgram(sum2Shader); - GLuint offset2=gl::processors+1; - glUniform1ui(glGetUniformLocation(sum2Shader,"offset2"),offset2); - glDispatchCompute(gl::gs,1,1); + glDispatchCompute(gl::g,1,1); - glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT); + if(gl::elements <= gl::groupSize*gl::groupSize) + glUseProgram(sum2fastShader); + else { + glUseProgram(sum2Shader); + glUniform1ui(glGetUniformLocation(sum2Shader,"blockSize"), + gl::ceilquotient(gl::g,gl::localSize)); + } + glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); + glDispatchCompute(1,1,1); glUseProgram(sum3Shader); - glUniform1ui(glGetUniformLocation(sum3Shader,"offset2"),offset2); - glUniform1ui(glGetUniformLocation(sum3Shader,"final"),offset2+gl::gs2); + glUniform1ui(glGetUniformLocation(sum3Shader,"final"),gl::elements-1); + glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT); glDispatchCompute(gl::g,1,1); +} - glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT); - // Compute global partial sums, including number of fragments, on the CPU - GLuint *sum=(GLuint *) glMapBuffer(GL_SHADER_STORAGE_BUFFER,GL_READ_WRITE); +void resizeFragmentBuffer() +{ + if(GPUindexing) { + glMemoryBarrier(GL_BUFFER_UPDATE_BARRIER_BIT); + + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::feedbackBuffer); + GLuint *feedback=(GLuint *) glMapBuffer(GL_SHADER_STORAGE_BUFFER,GL_READ_ONLY); - if(readSize) { - gl::maxSize=sum[0]; - sum[0]=0; - if(gl::maxSize > gl::lastSize) - gl::resizeBlendShader(); + GLuint maxDepth=feedback[0]; + if(maxDepth > gl::maxSize) + gl::resizeBlendShader(maxDepth); + + fragments=feedback[1]; + glUnmapBuffer(GL_SHADER_STORAGE_BUFFER); } - fragments=sum[1]; - for(GLint i=2; i < gl::gs; ++i) - sum[i]=fragments += sum[i]; - fragments += sum[gl::gs]; + if(fragments > maxFragments) { + // Initialize the alpha buffer + maxFragments=11*fragments/10; + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::fragmentBuffer); + glBufferData(GL_SHADER_STORAGE_BUFFER,maxFragments*sizeof(glm::vec4), + NULL,GL_DYNAMIC_DRAW); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER,4,camp::fragmentBuffer); + - glUnmapBuffer(GL_SHADER_STORAGE_BUFFER); + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::depthBuffer); + glBufferData(GL_SHADER_STORAGE_BUFFER,maxFragments*sizeof(GLfloat), + NULL,GL_DYNAMIC_DRAW); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER,5,camp::depthBuffer); - return fragments; + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::feedbackBuffer); + } } void refreshBuffers() { GLuint zero=0; - GLuint fragments; - gl::pixels=gl::Width*gl::Height; + gl::pixels=(gl::Width+1)*(gl::Height+1); if(initSSBO) { gl::processors=1; + GLuint Pixels; + if(GPUindexing) { + GLuint G=gl::ceilquotient(gl::pixels,gl::groupSize); + Pixels=gl::groupSize*G; + + GLuint globalSize=gl::localSize*gl::ceilquotient(G,gl::localSize); + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::globalSumBuffer); + glBufferData(GL_SHADER_STORAGE_BUFFER,globalSize*sizeof(GLuint),NULL, + GL_DYNAMIC_READ); + glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R32UI,GL_RED_INTEGER, + GL_UNSIGNED_INT,&zero); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER,3,camp::globalSumBuffer); + } else Pixels=gl::pixels; + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::offsetBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER, - (GPUindexing ? 2 : 1)*(gl::pixels+1)*sizeof(GLuint), + glBufferData(GL_SHADER_STORAGE_BUFFER,(Pixels+2)*sizeof(GLuint), NULL,GL_DYNAMIC_DRAW); glBindBufferBase(GL_SHADER_STORAGE_BUFFER,0,camp::offsetBuffer); + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::countBuffer); + glBufferData(GL_SHADER_STORAGE_BUFFER,(Pixels+2)*sizeof(GLuint), + NULL,GL_DYNAMIC_DRAW); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER,2,camp::countBuffer); + if(GPUcompress) { glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::indexBuffer); glBufferData(GL_SHADER_STORAGE_BUFFER,gl::pixels*sizeof(GLuint), NULL,GL_DYNAMIC_DRAW); glBindBufferBase(GL_SHADER_STORAGE_BUFFER,1,camp::indexBuffer); - glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R32UI,GL_RED_INTEGER, - GL_UNSIGNED_INT,&zero); GLuint one=1; glBindBuffer(GL_ATOMIC_COUNTER_BUFFER,camp::elementsBuffer); glBufferData(GL_ATOMIC_COUNTER_BUFFER,sizeof(GLuint),&one, GL_DYNAMIC_DRAW); glBindBufferBase(GL_ATOMIC_COUNTER_BUFFER,0,camp::elementsBuffer); - } - - if(!GPUindexing) { - glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::countBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER,(gl::pixels+1)*sizeof(GLuint), - NULL,GL_DYNAMIC_DRAW); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER,2,camp::countBuffer); - } + } else + glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R8UI,GL_RED_INTEGER, + GL_UNSIGNED_BYTE,&zero); // Clear the count buffer glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::opaqueBuffer); glBufferData(GL_SHADER_STORAGE_BUFFER,gl::pixels*sizeof(glm::vec4),NULL, @@ -2443,10 +2457,25 @@ void refreshBuffers() glBindBufferBase(GL_SHADER_STORAGE_BUFFER,7,camp::opaqueDepthBuffer); const GLfloat zerof=0.0; glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R32F,GL_RED,GL_FLOAT,&zerof); + + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::feedbackBuffer); + glBufferData(GL_SHADER_STORAGE_BUFFER,2*sizeof(GLuint),NULL, + GL_DYNAMIC_DRAW); + glBindBufferBase(GL_SHADER_STORAGE_BUFFER,8,camp::feedbackBuffer); + + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::feedbackBuffer); + initSSBO=false; } // Determine the fragment offsets + if(gl::exporting && GPUindexing && !GPUcompress) { + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::countBuffer); + glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R8UI,GL_RED_INTEGER, + GL_UNSIGNED_BYTE,&zero); + glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::feedbackBuffer); + } + if(!interlock) { drawBuffer(material1Data,countShader); drawBuffer(materialData,countShader); @@ -2462,7 +2491,6 @@ void refreshBuffers() if(GPUcompress) { compressCount(); - GLuint *p=(GLuint *) glMapBuffer(GL_ATOMIC_COUNTER_BUFFER,GL_READ_WRITE); gl::elements=GPUindexing ? p[0] : p[0]-1; p[0]=1; @@ -2471,52 +2499,37 @@ void refreshBuffers() } else gl::elements=gl::pixels; - if(initSSBO) { - if(GPUindexing) { - double Tmin=HUGE_VAL; - GLuint G=1; - GLuint twos3=2*gl::localsize*gl::localsize*gl::localsize; - - if(twos3 > gl::elements) { - gl::localsize=1; - twos3=2; - } else gl::localsize=settings::getSetting<Int>("GPUlocalSize"); - - if(gl::localsize != gl::lastlocalsize) { - gl::deleteComputeShaders(); - gl::initComputeShaders(); - gl::lastlocalsize=gl::localsize; - } + if(GPUindexing) { + gl::g=gl::ceilquotient(gl::elements,gl::groupSize); + gl::elements=gl::groupSize*gl::g; - GLint stop=min(gl::maxgroups,(GLint) (gl::elements/twos3)); - for(gl::g=2; gl::g <= stop; gl::g *= 2) { - initPartialSums(); - partialSums(); - seconds(); + if(settings::verbose > 3) { + static bool first=true; + if(first) { partialSums(); - double T=seconds(); - if(T < Tmin) { - Tmin=T; - G=gl::g; - } + first=false; } - gl::g=G; - initPartialSums(); + unsigned int N=10000; + seconds(); + for(unsigned int i=0; i < N; ++i) + partialSums(); + glFinish(); + double T=seconds()/N; + cout << "elements=" << gl::elements << endl; + cout << "Tmin (ms)=" << T*1e3 << endl; + cout << "Megapixels/second=" << gl::elements/T/1e6 << endl; } - initSSBO=false; - } - if(GPUindexing) - fragments=partialSums(true); - else { + partialSums(true); + } else { size_t size=gl::elements*sizeof(GLuint); // Compute partial sums on the CPU glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::countBuffer); GLuint *p=(GLuint *) glMapBufferRange(GL_SHADER_STORAGE_BUFFER, - 0,size+sizeof(GLuint), + 0,size+sizeof(GLuint), GL_MAP_READ_BIT); - gl::maxSize=p[0]; + GLuint maxsize=p[0]; GLuint *count=p+1; glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::offsetBuffer); @@ -2535,36 +2548,16 @@ void refreshBuffers() glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::countBuffer); glUnmapBuffer(GL_SHADER_STORAGE_BUFFER); - if(gl::exporting && !GPUindexing) { - GLuint zero=0; + if(gl::exporting) { glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::countBuffer); glClearBufferData(GL_SHADER_STORAGE_BUFFER,GL_R32UI,GL_RED_INTEGER, GL_UNSIGNED_INT,&zero); } else clearCount(); - if(gl::maxSize > gl::lastSize) - gl::resizeBlendShader(); - } - - if(fragments > maxFragments) { - // Initialize the alpha buffer - maxFragments=11*fragments/10; - glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::fragmentBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER,maxFragments*sizeof(glm::vec4), - NULL,GL_DYNAMIC_DRAW); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER,4,camp::fragmentBuffer); - - - glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::depthBuffer); - glBufferData(GL_SHADER_STORAGE_BUFFER,maxFragments*sizeof(GLfloat), - NULL,GL_DYNAMIC_DRAW); - glBindBufferBase(GL_SHADER_STORAGE_BUFFER,5,camp::depthBuffer); - - if(GPUindexing) - glBindBuffer(GL_SHADER_STORAGE_BUFFER,camp::globalSumBuffer); + if(maxsize > gl::maxSize) + gl::resizeBlendShader(maxsize); } - gl::lastshader=-1; } @@ -2577,18 +2570,6 @@ void setUniforms(vertexBuffer& data, GLint shader) if(normal) glUniform1ui(glGetUniformLocation(shader,"width"),gl::Width); - - if(camp::ssbo && GPUindexing && - (shader == transparentShader || !interlock)) { - GLuint offset2=1+gl::processors; - glUniform1ui(glGetUniformLocation(shader,"elements"),gl::elements); - glUniform1ui(glGetUniformLocation(shader,"offset2"),offset2); - GLuint m=gl::elements/gl::processors; - GLuint r=gl::elements-m*gl::processors; - glUniform1ui(glGetUniformLocation(shader,"m1"),m); - glUniform1ui(glGetUniformLocation(shader,"m2"),gl::localsize); - glUniform1ui(glGetUniformLocation(shader,"r"),r); - } } glUniformMatrix4fv(glGetUniformLocation(shader,"projViewMat"),1,GL_FALSE, @@ -2747,16 +2728,6 @@ void aBufferTransparency() glUseProgram(blendShader); gl::lastshader=blendShader; glUniform1ui(glGetUniformLocation(blendShader,"width"),gl::Width); - if(GPUindexing) { - GLuint offset2=gl::processors+1; - glUniform1ui(glGetUniformLocation(blendShader,"elements"),gl::elements); - glUniform1ui(glGetUniformLocation(blendShader,"offset2"),offset2); - GLuint m=gl::elements/gl::processors; - GLuint r=gl::elements-m*gl::processors; - glUniform1ui(glGetUniformLocation(blendShader,"m1"),m); - glUniform1ui(glGetUniformLocation(blendShader,"m2"),gl::localsize); - glUniform1ui(glGetUniformLocation(blendShader,"r"),r); - } glUniform4f(glGetUniformLocation(blendShader,"background"), gl::Background[0],gl::Background[1],gl::Background[2], gl::Background[3]); @@ -2792,7 +2763,10 @@ void drawBuffers() if(camp::ssbo) { if(transparent) { refreshBuffers(); - if(!interlock) gl::copied=true; + if(!interlock) { + resizeFragmentBuffer(); + gl::copied=true; + } } } @@ -2804,6 +2778,7 @@ void drawBuffers() if(transparent) { gl::copied=true; + if(interlock) resizeFragmentBuffer(); drawTransparent(); } Opaque=0; diff --git a/graphics/asymptote/interact.cc b/graphics/asymptote/interact.cc index 6e21f15116..1009b1d477 100644 --- a/graphics/asymptote/interact.cc +++ b/graphics/asymptote/interact.cc @@ -123,6 +123,10 @@ void pre_readline() int fd=intcast(settings::getSetting<Int>("inpipe")); if(fd >= 0) { if(!fin) fin=fdopen(fd,"r"); + if(!fin) { + cerr << "Cannot open inpipe " << fd << endl; + exit(-1); + } Readline=readpipeline; } else { #if defined(HAVE_READLINE) && defined(HAVE_LIBCURSES) diff --git a/graphics/asymptote/jsfile.cc b/graphics/asymptote/jsfile.cc index 19eb66428f..7dc95c9bb6 100644 --- a/graphics/asymptote/jsfile.cc +++ b/graphics/asymptote/jsfile.cc @@ -8,6 +8,8 @@ using namespace settings; namespace camp { +const string s="document.asy."; + #ifndef HAVE_LIBGLM size_t materialIndex=0; #endif @@ -140,59 +142,59 @@ void jsfile::open(string name) out << newl << "<script>" << newl; out << newl - << "canvasWidth=" << gl::fullWidth << ";" << newl - << "canvasHeight=" << gl::fullHeight << ";" << newl << newl - << "webgl2=" << std::boolalpha << webgl2 << ";" + << s << "canvasWidth=" << gl::fullWidth << ";" << newl + << s << "canvasHeight=" << gl::fullHeight << ";" << newl << newl + << s << "webgl2=" << std::boolalpha << webgl2 << ";" << newl - << "ibl=" << std::boolalpha << ibl << ";" + << s << "ibl=" << std::boolalpha << ibl << ";" << newl - << "absolute=" << std::boolalpha << getSetting<bool>("absolute") << ";" + << s << "absolute=" << std::boolalpha << getSetting<bool>("absolute") << ";" << newl; if(ibl) { - out << "imageURL=\"" << getSetting<string>("imageURL")+"/\";" << newl; - out << "image=\"" << getSetting<string>("image") << "\";" << newl << newl; + out << s << "imageURL=\"" << getSetting<string>("imageURL")+"/\";" << newl; + out << s << "image=\"" << getSetting<string>("image") << "\";" << newl << newl; } out << newl - << "minBound=[" << gl::Xmin << "," << gl::Ymin << "," << gl::Zmin << "];" + << s << "minBound=[" << gl::Xmin << "," << gl::Ymin << "," << gl::Zmin << "];" << newl - << "maxBound=[" << gl::Xmax << "," << gl::Ymax << "," << gl::Zmax << "];" + << s << "maxBound=[" << gl::Xmax << "," << gl::Ymax << "," << gl::Zmax << "];" << newl - << "orthographic=" << gl::orthographic << ";" + << s << "orthographic=" << gl::orthographic << ";" << newl - << "angleOfView=" << gl::Angle << ";" + << s << "angleOfView=" << gl::Angle << ";" << newl - << "initialZoom=" << gl::Zoom0 << ";" << newl; + << s << "initialZoom=" << gl::Zoom0 << ";" << newl; if(gl::Shift != pair(0.0,0.0)) - out << "viewportShift=" << gl::Shift*gl::Zoom0 << ";" << newl; - out << "viewportMargin=" << gl::Margin << ";" << newl << newl - << "zoomFactor=" << getSetting<double>("zoomfactor") << ";" << newl - << "zoomPinchFactor=" << getSetting<double>("zoomPinchFactor") << ";" + out << s << "viewportShift=" << gl::Shift*gl::Zoom0 << ";" << newl; + out << s << "viewportMargin=" << gl::Margin << ";" << newl << newl + << s << "zoomFactor=" << getSetting<double>("zoomfactor") << ";" << newl + << s << "zoomPinchFactor=" << getSetting<double>("zoomPinchFactor") << ";" << newl - << "zoomPinchCap=" << getSetting<double>("zoomPinchCap") << ";" << newl - << "zoomStep=" << getSetting<double>("zoomstep") << ";" << newl - << "shiftHoldDistance=" << getSetting<double>("shiftHoldDistance") << ";" + << s << "zoomPinchCap=" << getSetting<double>("zoomPinchCap") << ";" << newl + << s << "zoomStep=" << getSetting<double>("zoomstep") << ";" << newl + << s << "shiftHoldDistance=" << getSetting<double>("shiftHoldDistance") << ";" << newl - << "shiftWaitTime=" << getSetting<double>("shiftWaitTime") << ";" + << s << "shiftWaitTime=" << getSetting<double>("shiftWaitTime") << ";" << newl - << "vibrateTime=" << getSetting<double>("vibrateTime") << ";" - << newl << newl - << "Lights=["; - for(size_t i=0; i < gl::nlights; ++i) { - size_t i4=4*i; - out << "new Light(" << newl - << gl::Lights[i] << "," << newl - << "[" << gl::Diffuse[i4] << "," << gl::Diffuse[i4+1] << "," - << gl::Diffuse[i4+2] << "])," << newl; - } - out << "];" << newl << newl; - out << "Background=[" << gl::Background[0] << "," << gl::Background[1] << "," + << s << "vibrateTime=" << getSetting<double>("vibrateTime") << ";" + << newl << newl; + out << s << "background=[" << gl::Background[0] << "," << gl::Background[1] << "," << gl::Background[2] << "," << gl::Background[3] << "];" << newl << newl; - out << "Transform=[" << gl::T[0]; + out << s << "Transform=[" << gl::T[0]; for(int i=1; i < 16; ++i) out << "," << newl << gl::T[i]; out << "];" << newl << newl; + for(size_t i=0; i < gl::nlights; ++i) { + size_t i4=4*i; + out << "light(" << newl + << gl::Lights[i] << "," << newl + << "[" << gl::Diffuse[i4] << "," << gl::Diffuse[i4+1] << "," + << gl::Diffuse[i4+2] << "]);" << newl; + } + out << newl; + camp::clearCenters(); camp::clearMaterials(); #endif @@ -204,7 +206,7 @@ void jsfile::finish(string name) finished=true; size_t ncenters=drawElement::centers.size(); if(ncenters > 0) { - out << "Centers=["; + out << s << "Centers=["; for(size_t i=0; i < ncenters; ++i) out << newl << drawElement::centers[i] << ","; out << newl << "];" << newl; @@ -222,8 +224,7 @@ void jsfile::finish(string name) void jsfile::addColor(const prc::RGBAColour& c) { - out << "[" << byte(c.R) << "," << byte(c.G) << "," << byte(c.B) - << "," << byte(c.A) << "]"; + out << "[" << c.R << "," << c.G << "," << c.B << "," << c.A << "]"; } void jsfile::addIndices(const uint32_t *I) @@ -232,7 +233,6 @@ void jsfile::addIndices(const uint32_t *I) } void jsfile::addRawPatch(triple const* controls, size_t n, - const triple& Min, const triple& Max, const prc::RGBAColour *c, size_t nc) { out << "patch([" << newl; @@ -240,8 +240,7 @@ void jsfile::addRawPatch(triple const* controls, size_t n, for(size_t i=0; i < last; ++i) out << controls[i] << "," << newl; out << controls[last] << newl << "]," - << drawElement::centerIndex << "," << materialIndex << "," - << newl << Min << "," << newl << Max; + << drawElement::centerIndex << "," << materialIndex; if(c) { out << ",[" << newl; for(size_t i=0; i < nc; ++i) { @@ -254,35 +253,31 @@ void jsfile::addRawPatch(triple const* controls, size_t n, } void jsfile::addCurve(const triple& z0, const triple& c0, - const triple& c1, const triple& z1, - const triple& Min, const triple& Max) + const triple& c1, const triple& z1) { out << "curve([" << newl; out << z0 << "," << newl << c0 << "," << newl << c1 << "," << newl << z1 << newl << "]," - << drawElement::centerIndex << "," << materialIndex << "," - << newl << Min << "," << newl << Max << ");" << newl << newl; + << drawElement::centerIndex << "," << materialIndex + << ");" << newl << newl; } -void jsfile::addCurve(const triple& z0, const triple& z1, - const triple& Min, const triple& Max) +void jsfile::addCurve(const triple& z0, const triple& z1) { out << "curve([" << newl; out << z0 << "," << newl << z1 << newl << "]," - << drawElement::centerIndex << "," << materialIndex << "," - << newl << Min << "," << newl << Max << ");" << newl << newl; + << drawElement::centerIndex << "," << materialIndex + << ");" << newl << newl; } -void jsfile::addPixel(const triple& z0, double width, - const triple& Min, const triple& Max) +void jsfile::addPixel(const triple& z0, double width) { out << "pixel(" << newl; - out << z0 << "," << width << "," << newl - << materialIndex << "," << newl << Min << "," << newl << Max << ");" - << newl << newl; + out << z0 << "," << width << "," << newl << materialIndex + << ");" << newl << newl; } #ifdef HAVE_LIBGLM @@ -297,8 +292,7 @@ void jsfile::addMaterial(Material const& material) void jsfile::addTriangles(size_t nP, const triple* P, size_t nN, const triple* N, size_t nC, const prc::RGBAColour* C, size_t nI, const uint32_t (*PI)[3], - const uint32_t (*NI)[3], const uint32_t (*CI)[3], - const triple& Min, const triple& Max) + const uint32_t (*NI)[3], const uint32_t (*CI)[3]) { for(size_t i=0; i < nP; ++i) out << "Positions.push(" << P[i] << ");" << newl; @@ -330,8 +324,8 @@ void jsfile::addTriangles(size_t nP, const triple* P, size_t nN, out << "]);" << newl; } out << "triangles(" - << drawElement::centerIndex << "," << materialIndex << "," << newl - << newl << Min << "," << newl << Max << ");" << newl << newl; + << drawElement::centerIndex << "," << materialIndex + << ");" << newl << newl; } void jsfile::addSphere(const triple& center, double radius) @@ -371,9 +365,7 @@ void jsfile::addDisk(const triple& center, double radius, << ");" << newl << newl; } -void jsfile::addTube(const triple *g, double width, - const triple& Min, const triple& Max, bool core) - +void jsfile::addTube(const triple *g, double width, bool core) { out << "tube([" << g[0] << "," << newl @@ -381,37 +373,31 @@ void jsfile::addTube(const triple *g, double width, << g[2] << "," << newl << g[3] << newl << "]," << width << "," - << drawElement::centerIndex << "," << materialIndex << "," - << newl << Min << "," << newl << Max << "," << core <<");" - << newl << newl; + << drawElement::centerIndex << "," << materialIndex << "," << core + << ");" << newl << newl; } -void jsfile::addPatch(triple const* controls, - triple const& Min, triple const& Max, - prc::RGBAColour const* c) +void jsfile::addPatch(triple const* controls, prc::RGBAColour const* c) { - addRawPatch(controls,16,Min,Max,c,4); + addRawPatch(controls,16,c,4); } void jsfile::addStraightPatch(triple const* controls, - triple const& Min, triple const& Max, prc::RGBAColour const* c) { - addRawPatch(controls,4,Min,Max,c,4); + addRawPatch(controls,4,c,4); } void jsfile::addBezierTriangle(triple const* controls, - triple const& Min, triple const& Max, prc::RGBAColour const* c) { - addRawPatch(controls,10,Min,Max,c,3); + addRawPatch(controls,10,c,3); } void jsfile::addStraightBezierTriangle(triple const* controls, - triple const& Min, triple const& Max, prc::RGBAColour const* c) { - addRawPatch(controls,3,Min,Max,c,3); + addRawPatch(controls,3,c,3); } } diff --git a/graphics/asymptote/jsfile.h b/graphics/asymptote/jsfile.h index 9b4ca44dc1..385f2b0967 100644 --- a/graphics/asymptote/jsfile.h +++ b/graphics/asymptote/jsfile.h @@ -21,28 +21,23 @@ public: void close() override; void addCurve(const triple& z0, const triple& c0, - const triple& c1, const triple& z1, - const triple& Min, const triple& Max) override; + const triple& c1, const triple& z1) override; - void addCurve(const triple& z0, const triple& z1, - const triple& Min, const triple& Max) override; + void addCurve(const triple& z0, const triple& z1) override; - void addPixel(const triple& z0, double width, - const triple& Min, const triple& Max) override; + void addPixel(const triple& z0, double width) override; void addTriangles(size_t nP, const triple* P, size_t nN, const triple* N, size_t nC, const prc::RGBAColour* C, size_t nI, const uint32_t (*PI)[3], const uint32_t (*NI)[3], - const uint32_t (*CI)[3], - const triple& Min, const triple& Max) override; + const uint32_t (*CI)[3]) override; void addCylinder(const triple& center, double radius, double height, const double& polar, const double& azimuth, bool core) override; void addDisk(const triple& center, double radius, const double& polar, const double& azimuth) override; - void addTube(const triple *g, double width, - const triple& Min, const triple& Max, bool core) override; + void addTube(const triple *g, double width, bool core) override; #ifdef HAVE_LIBGLM void addMaterial(Material const& mat) override; @@ -52,18 +47,17 @@ public: void addHemisphere(triple const& center, double radius, double const& polar, double const& azimuth) override; - void addPatch(triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + void addPatch(triple const* controls, prc::RGBAColour const* c) override; - void - addStraightPatch(triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + void addStraightPatch(triple const* controls, + prc::RGBAColour const* c) override; - void - addBezierTriangle(triple const* control, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + void addBezierTriangle(triple const* controls, + prc::RGBAColour const* c) override; - void addStraightBezierTriangle(triple const* controls, triple const& Min, triple const& Max, + void addStraightBezierTriangle(triple const* controls, prc::RGBAColour const* c) override; - void svgtohtml(string name); void precision(int digits) override {out.precision(digits);} @@ -82,8 +76,8 @@ protected: void addColor(const prc::RGBAColour& c); void addIndices(const uint32_t *I); - void addRawPatch(const triple* controls, size_t n, const triple& Min, - const triple& Max, const prc::RGBAColour *colors, size_t nc); + void addRawPatch(const triple* controls, size_t n, + const prc::RGBAColour *colors, size_t nc); void addSphere(const triple& center, double radius, bool half=false, const double& polar=0.0, const double& azimuth=0.0); diff --git a/graphics/asymptote/lspserv.cc b/graphics/asymptote/lspserv.cc index 90dcc6961d..42f135b35f 100644 --- a/graphics/asymptote/lspserv.cc +++ b/graphics/asymptote/lspserv.cc @@ -22,10 +22,6 @@ #include "process.h" #include "locate.h" -#define GC_THREADS - -#include "gc.h" - #define REGISTER_REQ_FN(typ, fn) remoteEndPoint->registerHandler(\ [this](typ::request const& req) { return this->fn(req); }); #define REGISTER_NOTIF_FN(typ, handler) remoteEndPoint->registerHandler(\ diff --git a/graphics/asymptote/main.cc b/graphics/asymptote/main.cc index 4361e3dce4..6c69f669b9 100644 --- a/graphics/asymptote/main.cc +++ b/graphics/asymptote/main.cc @@ -193,9 +193,10 @@ void *asymain(void *A) } else { for(int ind=0; ind < n; ind++) { string name=(getArg(ind)); - if(name == stripExt(name)+".v3d") { + string prefix=stripExt(name); + if(name == prefix+".v3d") { interact::uptodate=false; - runString("import v3d; defaultfilename=\""+stripDir(name)+ + runString("import v3d; defaultfilename=\""+stripDir(prefix)+ "\"; importv3d(\""+name+"\");"); } else processFile(name,n > 1); diff --git a/graphics/asymptote/memory.h b/graphics/asymptote/memory.h index 8e878ef712..180260bc9d 100644 --- a/graphics/asymptote/memory.h +++ b/graphics/asymptote/memory.h @@ -50,6 +50,7 @@ #define GC_THREADS #ifdef __clang__ #define GC_ATTR_EXPLICIT +#define GC_NOEXCEPT #endif #include <gc.h> diff --git a/graphics/asymptote/picture.cc b/graphics/asymptote/picture.cc index 6dacbec2b4..6a28ad712a 100644 --- a/graphics/asymptote/picture.cc +++ b/graphics/asymptote/picture.cc @@ -359,7 +359,6 @@ void texinit() bool context=settings::context(getSetting<string>("tex")); string dir=stripFile(outname()); - dir=dir.substr(0,dir.length()-1); string logname; if(!context) logname=dir; logname += "texput.log"; @@ -371,6 +370,7 @@ void texinit() writeable.close(); unlink(cname); + dir=dir.substr(0,dir.length()-1); mem::vector<string> cmd; cmd.push_back(texprogram()); string oldPath; @@ -464,7 +464,7 @@ string dvisvgmCommand(mem::vector<string>& cmd, const string& outname) string libgs=getSetting<string>("libgs"); if(!libgs.empty()) cmd.push_back("--libgs="+libgs); -// cmd.push_back("--optimize"); // Requires dvisvgm > 2.9.1 + cmd.push_back("--optimize"); push_split(cmd,getSetting<string>("dvisvgmOptions")); string outfile=stripDir(outname); if(!outfile.empty()) @@ -685,7 +685,7 @@ int picture::pdftoeps(const string& pdfname, const string& epsname, bool eps) mem::vector<string> cmd; cmd.push_back(getSetting<string>("gs")); cmd.push_back("-q"); - cmd.push_back("-dNOCACHE"); + cmd.push_back("-dNoOutputFonts"); cmd.push_back("-dNOPAUSE"); cmd.push_back("-dBATCH"); cmd.push_back("-P"); diff --git a/graphics/asymptote/psfile.cc b/graphics/asymptote/psfile.cc index 6d882f4bed..924f3c1872 100644 --- a/graphics/asymptote/psfile.cc +++ b/graphics/asymptote/psfile.cc @@ -183,22 +183,37 @@ void psfile::epilogue() void psfile::setcolor(const pen& p, const string& begin="", const string& end="") { + ostringstream buf; if(p.cmyk() && (!lastpen.cmyk() || (p.cyan() != lastpen.cyan() || p.magenta() != lastpen.magenta() || p.yellow() != lastpen.yellow() || p.black() != lastpen.black()))) { - *out << begin << p.cyan() << " " << p.magenta() << " " << p.yellow() << " " - << p.black() << (pdf ? " k" : " setcmykcolor") << end << newl; + buf << begin << p.cyan() << " " << p.magenta() << " " << p.yellow() << " " + << p.black(); + if(pdf) { + *out << buf.str() << " k" << end << newl; + *out << buf.str() << " K" << end << newl; + } else + *out << buf.str() << " setcmykcolor" << end << newl; } else if(p.rgb() && (!lastpen.rgb() || (p.red() != lastpen.red() || p.green() != lastpen.green() || p.blue() != lastpen.blue()))) { - *out << begin << p.red() << " " << p.green() << " " << p.blue() - << (pdf ? " rg" : " setrgbcolor") << end << newl; + buf << begin << p.red() << " " << p.green() << " " << p.blue(); + if(pdf) { + *out << buf.str() << " rg" << end << newl; + *out << buf.str() << " RG" << end << newl; + } else + *out << buf.str() << " setrgbcolor" << end << newl; } else if(p.grayscale() && (!lastpen.grayscale() || p.gray() != lastpen.gray())) { - *out << begin << p.gray() << (pdf ? " g" : " setgray") << end << newl; + buf << begin << p.gray(); + if(pdf) { + *out << begin << p.gray() << " g" << end << newl; + *out << begin << p.gray() << " G" << end << newl; + } else + *out << begin << p.gray() << " setgray" << end << newl; } } diff --git a/graphics/asymptote/revision.cc b/graphics/asymptote/revision.cc index 88e864b455..bd8b881056 100644 --- a/graphics/asymptote/revision.cc +++ b/graphics/asymptote/revision.cc @@ -1,2 +1,2 @@ -const char *REVISION="2.80"; -const char *AsyGLVersion="1.01"; +const char *REVISION="2.82"; +const char *AsyGLVersion="1.02"; diff --git a/graphics/asymptote/runarray.cc b/graphics/asymptote/runarray.cc index bfa4ff4285..3e7a6f7093 100644 --- a/graphics/asymptote/runarray.cc +++ b/graphics/asymptote/runarray.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); @@ -61,7 +61,7 @@ function *realRealFunction(); #define CURRENTPEN processData().currentpen -#line 22 "runarray.in" +#line 23 "runarray.in" #include "array.h" #include "arrayop.h" #include "triple.h" @@ -77,6 +77,19 @@ static const char *installFFTW= "Please install fftw3, then ./configure; make"; #endif +#ifdef HAVE_EIGEN_DENSE +#include <Eigen/Dense> +typedef std::complex<double> Complex; +static const char *square="matrix must be square"; +using Eigen::MatrixXd; +using Eigen::MatrixXcd; +using Eigen::RealSchur; +using Eigen::ComplexSchur; +#else +static const char *installEIGEN= + "Please install eigen3, then ./configure; make"; +#endif + using namespace camp; using namespace vm; @@ -89,6 +102,7 @@ typedef array Intarray; typedef array Intarray2; typedef array realarray; typedef array realarray2; +typedef array realarray3; typedef array pairarray; typedef array pairarray2; typedef array pairarray3; @@ -99,6 +113,7 @@ using types::IntArray; using types::IntArray2; using types::realArray; using types::realArray2; +using types::realArray3; using types::pairArray; using types::pairArray2; using types::pairArray3; @@ -640,10 +655,10 @@ void integeroverflow(size_t i) #endif namespace run { // Create an empty array. -#line 594 "runarray.in" +#line 610 "runarray.in" void emptyArray(stack *Stack) { -#line 595 "runarray.in" +#line 611 "runarray.in" {Stack->push<array*>(new array(0)); return;} } @@ -652,11 +667,11 @@ void emptyArray(stack *Stack) // is popped off the stack, followed by each dimension in reverse order. // The array itself is technically a one dimensional array of one // dimension arrays and so on. -#line 604 "runarray.in" +#line 620 "runarray.in" void newDeepArray(stack *Stack) { Int depth=vm::pop<Int>(Stack); -#line 605 "runarray.in" +#line 621 "runarray.in" assert(depth > 0); Int *dims = new Int[depth]; @@ -675,11 +690,11 @@ void newDeepArray(stack *Stack) // Creates an array with elements already specified. First, the number // of elements is popped off the stack, followed by each element in // reverse order. -#line 624 "runarray.in" +#line 640 "runarray.in" void newInitializedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 625 "runarray.in" +#line 641 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -692,12 +707,12 @@ void newInitializedArray(stack *Stack) // Similar to newInitializedArray, but after the n elements, append another // array to it. -#line 638 "runarray.in" +#line 654 "runarray.in" void newAppendedArray(stack *Stack) { Int n=vm::pop<Int>(Stack); array* tail=vm::pop<array*>(Stack); -#line 639 "runarray.in" +#line 655 "runarray.in" assert(n >= 0); array *a = new array(n); @@ -714,14 +729,14 @@ void newAppendedArray(stack *Stack) // typeDepth is the true depth of the array determined at compile-time when the // operations for the array type are added. This typeDepth argument is // automatically pushed on the stack and is not visible to the user. -#line 656 "runarray.in" +#line 672 "runarray.in" void copyArrayValue(stack *Stack) { Int typeDepth=vm::pop<Int>(Stack); Int depth=vm::pop<Int>(Stack,Int_MAX); item value=vm::pop(Stack); Int n=vm::pop<Int>(Stack); -#line 657 "runarray.in" +#line 673 "runarray.in" if(n < 0) error("cannot create a negative length array"); if(depth < 0) error("cannot copy to a negative depth"); if(depth > typeDepth) depth=typeDepth; @@ -732,13 +747,13 @@ void copyArrayValue(stack *Stack) // typeDepth is the true depth of the array determined at compile-time when the // operations for the array type are added. This typeDepth argument is // automatically pushed on the stack and is not visible to the user. -#line 668 "runarray.in" +#line 684 "runarray.in" void copyArray(stack *Stack) { Int typeDepth=vm::pop<Int>(Stack); Int depth=vm::pop<Int>(Stack,Int_MAX); array * a=vm::pop<array *>(Stack); -#line 669 "runarray.in" +#line 685 "runarray.in" if(a == 0) vm::error(dereferenceNullArray); if(depth < 0) error("cannot copy to a negative depth"); if(depth > typeDepth) depth=typeDepth; @@ -746,12 +761,12 @@ void copyArray(stack *Stack) } // Read an element from an array. Checks for initialization & bounds. -#line 677 "runarray.in" +#line 693 "runarray.in" void arrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 678 "runarray.in" +#line 694 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) { ostringstream buf; @@ -762,37 +777,37 @@ void arrayRead(stack *Stack) } // Slice a substring from an array. -#line 689 "runarray.in" +#line 705 "runarray.in" void arraySliceRead(stack *Stack) { Int right=vm::pop<Int>(Stack); Int left=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 690 "runarray.in" +#line 706 "runarray.in" checkArray(a); {Stack->push(a->slice(left, right)); return;} } // Slice a substring from an array. This implements the cases a[i:] and a[:] // where the endpoint is not given, and assumed to be the length of the array. -#line 697 "runarray.in" +#line 713 "runarray.in" void arraySliceReadToEnd(stack *Stack) { Int left=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 698 "runarray.in" +#line 714 "runarray.in" size_t len=checkArray(a); {Stack->push(a->slice(left, (Int)len)); return;} } // Read an element from an array of arrays. Check bounds and initialize // as necessary. -#line 705 "runarray.in" +#line 721 "runarray.in" void arrayArrayRead(stack *Stack) { Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 706 "runarray.in" +#line 722 "runarray.in" item& i=arrayRead(a,n); if (i.empty()) i=new array(0); {Stack->push(i); return;} @@ -800,13 +815,13 @@ void arrayArrayRead(stack *Stack) // Write an element to an array. Increase size if necessary. // TODO: Add arrayWriteAndPop -#line 714 "runarray.in" +#line 730 "runarray.in" void arrayWrite(stack *Stack) { item value=vm::pop(Stack); Int n=vm::pop<Int>(Stack); array * a=vm::pop<array *>(Stack); -#line 715 "runarray.in" +#line 731 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -820,27 +835,27 @@ void arrayWrite(stack *Stack) {Stack->push(value); return;} } -#line 729 "runarray.in" +#line 745 "runarray.in" void arraySliceWrite(stack *Stack) { array * src=vm::pop<array *>(Stack); Int right=vm::pop<Int>(Stack); Int left=vm::pop<Int>(Stack); array * dest=vm::pop<array *>(Stack); -#line 730 "runarray.in" +#line 746 "runarray.in" checkArray(src); checkArray(dest); dest->setSlice(left, right, src); {Stack->push<array*>(src); return;} } -#line 737 "runarray.in" +#line 753 "runarray.in" void arraySliceWriteToEnd(stack *Stack) { array * src=vm::pop<array *>(Stack); Int left=vm::pop<Int>(Stack); array * dest=vm::pop<array *>(Stack); -#line 738 "runarray.in" +#line 754 "runarray.in" checkArray(src); size_t len=checkArray(dest); dest->setSlice(left, (Int) len, src); @@ -848,20 +863,20 @@ void arraySliceWriteToEnd(stack *Stack) } // Returns the length of an array. -#line 746 "runarray.in" +#line 762 "runarray.in" void arrayLength(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 747 "runarray.in" +#line 763 "runarray.in" {Stack->push<Int>((Int) checkArray(a)); return;} } // Returns an array of integers representing the keys of the array. -#line 752 "runarray.in" +#line 768 "runarray.in" void arrayKeys(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 753 "runarray.in" +#line 769 "runarray.in" size_t size=checkArray(a); array *keys=new array(); @@ -875,33 +890,33 @@ void arrayKeys(stack *Stack) } // Return the cyclic flag for an array. -#line 767 "runarray.in" +#line 783 "runarray.in" void arrayCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 768 "runarray.in" +#line 784 "runarray.in" checkArray(a); {Stack->push<bool>(a->cyclic()); return;} } -#line 773 "runarray.in" +#line 789 "runarray.in" void arraySetCyclicFlag(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 774 "runarray.in" +#line 790 "runarray.in" checkArray(a); a->cyclic(b); {Stack->push<bool>(b); return;} } // Check to see if an array element is initialized. -#line 781 "runarray.in" +#line 797 "runarray.in" void arrayInitializedHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); Int n=vm::pop<Int>(Stack); -#line 782 "runarray.in" +#line 798 "runarray.in" size_t len=checkArray(a); bool cyclic=a->cyclic(); if(cyclic && len > 0) n=imod(n,len); @@ -911,62 +926,62 @@ void arrayInitializedHelper(stack *Stack) } // Returns the initialize method for an array. -#line 792 "runarray.in" +#line 808 "runarray.in" void arrayInitialized(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 793 "runarray.in" +#line 809 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayInitializedHelper),a)); return;} } // The helper function for the cyclic method that sets the cyclic flag. -#line 798 "runarray.in" +#line 814 "runarray.in" void arrayCyclicHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); bool b=vm::pop<bool>(Stack); -#line 799 "runarray.in" +#line 815 "runarray.in" checkArray(a); a->cyclic(b); } // Set the cyclic flag for an array. -#line 805 "runarray.in" +#line 821 "runarray.in" void arrayCyclic(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 806 "runarray.in" +#line 822 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayCyclicHelper),a)); return;} } // The helper function for the push method that does the actual operation. -#line 811 "runarray.in" +#line 827 "runarray.in" void arrayPushHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); item x=vm::pop(Stack); -#line 812 "runarray.in" +#line 828 "runarray.in" checkArray(a); a->push(x); {Stack->push(x); return;} } // Returns the push method for an array. -#line 819 "runarray.in" +#line 835 "runarray.in" void arrayPush(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 820 "runarray.in" +#line 836 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayPushHelper),a)); return;} } // The helper function for the append method that appends b to a. -#line 825 "runarray.in" +#line 841 "runarray.in" void arrayAppendHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); array * b=vm::pop<array *>(Stack); -#line 826 "runarray.in" +#line 842 "runarray.in" checkArray(a); size_t size=checkArray(b); for(size_t i=0; i < size; i++) @@ -974,20 +989,20 @@ void arrayAppendHelper(stack *Stack) } // Returns the append method for an array. -#line 834 "runarray.in" +#line 850 "runarray.in" void arrayAppend(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 835 "runarray.in" +#line 851 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayAppendHelper),a)); return;} } // The helper function for the pop method. -#line 840 "runarray.in" +#line 856 "runarray.in" void arrayPopHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 841 "runarray.in" +#line 857 "runarray.in" size_t asize=checkArray(a); if(asize == 0) error("cannot pop element from empty array"); @@ -995,22 +1010,22 @@ void arrayPopHelper(stack *Stack) } // Returns the pop method for an array. -#line 849 "runarray.in" +#line 865 "runarray.in" void arrayPop(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 850 "runarray.in" +#line 866 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayPopHelper),a)); return;} } // The helper function for the insert method. -#line 855 "runarray.in" +#line 871 "runarray.in" void arrayInsertHelper(stack *Stack) { array * a=vm::pop<array *>(Stack); array * x=vm::pop<array *>(Stack); Int i=vm::pop<Int>(Stack); -#line 856 "runarray.in" +#line 872 "runarray.in" size_t asize=checkArray(a); checkArray(x); if(a->cyclic() && asize > 0) i=imod(i,asize); @@ -1020,39 +1035,39 @@ void arrayInsertHelper(stack *Stack) } // Returns the insert method for an array. -#line 866 "runarray.in" +#line 882 "runarray.in" void arrayInsert(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 867 "runarray.in" +#line 883 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayInsertHelper),a)); return;} } // Returns the delete method for an array. -#line 872 "runarray.in" +#line 888 "runarray.in" void arrayDelete(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 873 "runarray.in" +#line 889 "runarray.in" {Stack->push<callable*>(new thunk(new bfunc(arrayDeleteHelper),a)); return;} } -#line 877 "runarray.in" +#line 893 "runarray.in" void arrayAlias(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 878 "runarray.in" +#line 894 "runarray.in" {Stack->push<bool>(a==b); return;} } // Return array formed by indexing array a with elements of integer array b -#line 883 "runarray.in" +#line 899 "runarray.in" void arrayIntArray(stack *Stack) { array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 884 "runarray.in" +#line 900 "runarray.in" size_t asize=checkArray(a); size_t bsize=checkArray(b); array *r=new array(bsize); @@ -1070,13 +1085,13 @@ void arrayIntArray(stack *Stack) // returns the complement of the integer array a in {0,2,...,n-1}, // so that b[complement(a,b.length)] yields the complement of b[a]. -#line 902 "runarray.in" +#line 918 "runarray.in" // Intarray* complement(Intarray *a, Int n); void gen_runarray32(stack *Stack) { Int n=vm::pop<Int>(Stack); Intarray * a=vm::pop<Intarray *>(Stack); -#line 903 "runarray.in" +#line 919 "runarray.in" size_t asize=checkArray(a); array *r=new array(0); bool *keep=new bool[n]; @@ -1093,12 +1108,12 @@ void gen_runarray32(stack *Stack) } // Generate the sequence {f(i) : i=0,1,...n-1} given a function f and integer n -#line 920 "runarray.in" +#line 936 "runarray.in" void arraySequence(stack *Stack) { Int n=vm::pop<Int>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 921 "runarray.in" +#line 937 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -1110,12 +1125,12 @@ void arraySequence(stack *Stack) } // Return the array {0,1,...n-1} -#line 933 "runarray.in" +#line 949 "runarray.in" // Intarray* sequence(Int n); void gen_runarray34(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 934 "runarray.in" +#line 950 "runarray.in" if(n < 0) n=0; array *a=new array(n); for(Int i=0; i < n; ++i) { @@ -1125,12 +1140,12 @@ void gen_runarray34(stack *Stack) } // Apply a function to each element of an array -#line 944 "runarray.in" +#line 960 "runarray.in" void arrayFunction(stack *Stack) { array * a=vm::pop<array *>(Stack); callable * f=vm::pop<callable *>(Stack); -#line 945 "runarray.in" +#line 961 "runarray.in" size_t size=checkArray(a); array *b=new array(size); for(size_t i=0; i < size; ++i) { @@ -1141,13 +1156,13 @@ void arrayFunction(stack *Stack) {Stack->push<array*>(b); return;} } -#line 956 "runarray.in" +#line 972 "runarray.in" void arraySort(stack *Stack) { bool stable=vm::pop<bool>(Stack,true); callable * less=vm::pop<callable *>(Stack); array * a=vm::pop<array *>(Stack); -#line 957 "runarray.in" +#line 973 "runarray.in" array *c=copyArray(a); compareFunc=less; FuncStack=Stack; @@ -1156,13 +1171,13 @@ void arraySort(stack *Stack) {Stack->push<array*>(c); return;} } -#line 966 "runarray.in" +#line 982 "runarray.in" void arraySearch(stack *Stack) { callable * less=vm::pop<callable *>(Stack); item key=vm::pop(Stack); array * a=vm::pop<array *>(Stack); -#line 967 "runarray.in" +#line 983 "runarray.in" size_t size=a->size(); compareFunc=less; FuncStack=Stack; @@ -1180,12 +1195,12 @@ void arraySearch(stack *Stack) {Stack->push<Int>(0); return;} } -#line 985 "runarray.in" +#line 1001 "runarray.in" // bool all(boolarray *a); void gen_runarray38(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 986 "runarray.in" +#line 1002 "runarray.in" size_t size=checkArray(a); bool c=true; for(size_t i=0; i < size; i++) @@ -1193,12 +1208,12 @@ void gen_runarray38(stack *Stack) {Stack->push<bool>(c); return;} } -#line 994 "runarray.in" +#line 1010 "runarray.in" // boolarray* !(boolarray* a); void gen_runarray39(stack *Stack) { boolarray* a=vm::pop<boolarray*>(Stack); -#line 995 "runarray.in" +#line 1011 "runarray.in" size_t size=checkArray(a); array *c=new array(size); for(size_t i=0; i < size; i++) @@ -1206,12 +1221,12 @@ void gen_runarray39(stack *Stack) {Stack->push<boolarray*>(c); return;} } -#line 1003 "runarray.in" +#line 1019 "runarray.in" // Int sum(boolarray *a); void gen_runarray40(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 1004 "runarray.in" +#line 1020 "runarray.in" size_t size=checkArray(a); Int sum=0; for(size_t i=0; i < size; i++) @@ -1219,11 +1234,11 @@ void gen_runarray40(stack *Stack) {Stack->push<Int>(sum); return;} } -#line 1012 "runarray.in" +#line 1028 "runarray.in" void arrayConcat(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 1013 "runarray.in" +#line 1029 "runarray.in" // a is an array of arrays to be concatenated together. // The signature is // T[] concat(... T[][] a); @@ -1250,11 +1265,11 @@ void arrayConcat(stack *Stack) {Stack->push<array*>(result); return;} } -#line 1040 "runarray.in" +#line 1056 "runarray.in" void array2Transpose(stack *Stack) { array * a=vm::pop<array *>(Stack); -#line 1041 "runarray.in" +#line 1057 "runarray.in" size_t asize=checkArray(a); array *c=new array(0); size_t csize=0; @@ -1283,12 +1298,12 @@ void array2Transpose(stack *Stack) // permutation (021 or 120, etc; original is 012). // Transpose by sending respective members to the permutated locations: // return the array obtained by putting a[i][j][k] into position perm{ijk}. -#line 1070 "runarray.in" +#line 1086 "runarray.in" void array3Transpose(stack *Stack) { array * perm=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 1071 "runarray.in" +#line 1087 "runarray.in" const size_t DIM=3; if(checkArray(perm) != DIM) { @@ -1372,13 +1387,13 @@ void array3Transpose(stack *Stack) // Find the index of the nth true value in a boolean array or -1 if not found. // If n is negative, search backwards. -#line 1155 "runarray.in" +#line 1171 "runarray.in" // Int find(boolarray *a, Int n=1); void gen_runarray44(stack *Stack) { Int n=vm::pop<Int>(Stack,1); boolarray * a=vm::pop<boolarray *>(Stack); -#line 1156 "runarray.in" +#line 1172 "runarray.in" size_t size=checkArray(a); Int j=-1; if(n > 0) @@ -1395,12 +1410,12 @@ void gen_runarray44(stack *Stack) } // Find all indices of true values in a boolean array. -#line 1173 "runarray.in" +#line 1189 "runarray.in" // Intarray* findall(boolarray *a); void gen_runarray45(stack *Stack) { boolarray * a=vm::pop<boolarray *>(Stack); -#line 1174 "runarray.in" +#line 1190 "runarray.in" size_t size=checkArray(a); array *b=new array(0); for(size_t i=0; i < size; i++) { @@ -1413,13 +1428,13 @@ void gen_runarray45(stack *Stack) // construct vector obtained by replacing those elements of b for which the // corresponding elements of a are false by the corresponding element of c. -#line 1187 "runarray.in" +#line 1203 "runarray.in" void arrayConditional(stack *Stack) { array * c=vm::pop<array *>(Stack); array * b=vm::pop<array *>(Stack); array * a=vm::pop<array *>(Stack); -#line 1188 "runarray.in" +#line 1204 "runarray.in" size_t size=checkArray(a); array *r=new array(size); if(b && c) { @@ -1443,22 +1458,22 @@ void arrayConditional(stack *Stack) } // Return an n x n identity matrix. -#line 1212 "runarray.in" +#line 1228 "runarray.in" // realarray2* identity(Int n); void gen_runarray47(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 1213 "runarray.in" +#line 1229 "runarray.in" {Stack->push<realarray2*>(Identity(n)); return;} } // Return the inverse of an n x n matrix a using Gauss-Jordan elimination. -#line 1218 "runarray.in" +#line 1234 "runarray.in" // realarray2* inverse(realarray2 *a); void gen_runarray48(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1219 "runarray.in" +#line 1235 "runarray.in" size_t n=checkArray(a); double *A; copyArray2C(A,a,true,0,NoGC); @@ -1471,14 +1486,14 @@ void gen_runarray48(stack *Stack) // Solve the linear equation ax=b by LU decomposition, returning the // solution x, where a is an n x n matrix and b is an array of length n. // If no solution exists, return an empty array. -#line 1232 "runarray.in" +#line 1248 "runarray.in" // realarray* solve(realarray2 *a, realarray *b, bool warn=true); void gen_runarray49(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1233 "runarray.in" +#line 1249 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray*>(new array(0)); return;} @@ -1530,14 +1545,14 @@ void gen_runarray49(stack *Stack) // Solve the linear equation ax=b by LU decomposition, returning the // solution x, where a is an n x n matrix and b is an n x m matrix. // If no solution exists, return an empty array. -#line 1285 "runarray.in" +#line 1301 "runarray.in" // realarray2* solve(realarray2 *a, realarray2 *b, bool warn=true); void gen_runarray50(stack *Stack) { bool warn=vm::pop<bool>(Stack,true); realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1286 "runarray.in" +#line 1302 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<realarray2*>(new array(0)); return;} @@ -1599,12 +1614,12 @@ void gen_runarray50(stack *Stack) } // Compute the determinant of an n x n matrix. -#line 1348 "runarray.in" +#line 1364 "runarray.in" // real determinant(realarray2 *a); void gen_runarray51(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1349 "runarray.in" +#line 1365 "runarray.in" real *A; copyArray2C(A,a); size_t n=checkArray(a); @@ -1619,13 +1634,13 @@ void gen_runarray51(stack *Stack) {Stack->push<real>(det); return;} } -#line 1364 "runarray.in" +#line 1380 "runarray.in" // realarray* *(realarray2 *a, realarray *b); void gen_runarray52(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1365 "runarray.in" +#line 1381 "runarray.in" size_t n=checkArray(a); size_t m=checkArray(b); array *c=new array(n); @@ -1643,13 +1658,13 @@ void gen_runarray52(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1383 "runarray.in" +#line 1399 "runarray.in" // realarray* *(realarray *a, realarray2 *b); void gen_runarray53(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1384 "runarray.in" +#line 1400 "runarray.in" size_t n=checkArray(a); if(n != checkArray(b)) error(incommensurate); real *A; @@ -1677,62 +1692,62 @@ void gen_runarray53(stack *Stack) {Stack->push<realarray*>(c); return;} } -#line 1412 "runarray.in" +#line 1428 "runarray.in" // Intarray2* *(Intarray2 *a, Intarray2 *b); void gen_runarray54(stack *Stack) { Intarray2 * b=vm::pop<Intarray2 *>(Stack); Intarray2 * a=vm::pop<Intarray2 *>(Stack); -#line 1413 "runarray.in" +#line 1429 "runarray.in" {Stack->push<Intarray2*>(mult<Int>(a,b)); return;} } -#line 1417 "runarray.in" +#line 1433 "runarray.in" // realarray2* *(realarray2 *a, realarray2 *b); void gen_runarray55(stack *Stack) { realarray2 * b=vm::pop<realarray2 *>(Stack); realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1418 "runarray.in" +#line 1434 "runarray.in" {Stack->push<realarray2*>(mult<real>(a,b)); return;} } -#line 1422 "runarray.in" +#line 1438 "runarray.in" // pairarray2* *(pairarray2 *a, pairarray2 *b); void gen_runarray56(stack *Stack) { pairarray2 * b=vm::pop<pairarray2 *>(Stack); pairarray2 * a=vm::pop<pairarray2 *>(Stack); -#line 1423 "runarray.in" +#line 1439 "runarray.in" {Stack->push<pairarray2*>(mult<pair>(a,b)); return;} } -#line 1427 "runarray.in" +#line 1443 "runarray.in" // triple *(realarray2 *t, triple v); void gen_runarray57(stack *Stack) { triple v=vm::pop<triple>(Stack); realarray2 * t=vm::pop<realarray2 *>(Stack); -#line 1428 "runarray.in" +#line 1444 "runarray.in" {Stack->push<triple>(*t*v); return;} } -#line 1432 "runarray.in" +#line 1448 "runarray.in" // realarray2* AtA(realarray2 *a); void gen_runarray58(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 1433 "runarray.in" +#line 1449 "runarray.in" {Stack->push<realarray2*>(AtA<real>(a)); return;} } -#line 1437 "runarray.in" +#line 1453 "runarray.in" // pair project(triple v, realarray2 *t); void gen_runarray59(stack *Stack) { realarray2 * t=vm::pop<realarray2 *>(Stack); triple v=vm::pop<triple>(Stack); -#line 1438 "runarray.in" +#line 1454 "runarray.in" size_t n=checkArray(t); if(n != 4) error(incommensurate); array *t0=read<array*>(t,0); @@ -1757,13 +1772,13 @@ void gen_runarray59(stack *Stack) } // Compute the dot product of vectors a and b. -#line 1463 "runarray.in" +#line 1479 "runarray.in" // real dot(realarray *a, realarray *b); void gen_runarray60(stack *Stack) { realarray * b=vm::pop<realarray *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1464 "runarray.in" +#line 1480 "runarray.in" size_t n=checkArrays(a,b); real sum=0.0; for(size_t i=0; i < n; ++i) @@ -1772,13 +1787,13 @@ void gen_runarray60(stack *Stack) } // Compute the complex dot product of vectors a and b. -#line 1473 "runarray.in" +#line 1489 "runarray.in" // pair dot(pairarray *a, pairarray *b); void gen_runarray61(stack *Stack) { pairarray * b=vm::pop<pairarray *>(Stack); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1474 "runarray.in" +#line 1490 "runarray.in" size_t n=checkArrays(a,b); pair sum=zero; for(size_t i=0; i < n; ++i) @@ -1793,7 +1808,7 @@ void gen_runarray61(stack *Stack) // [ a[2] b[2] c[2] ] // [ ... ] // [ c[n-1] a[n-1] b[n-1] ] -#line 1489 "runarray.in" +#line 1505 "runarray.in" // realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f); void gen_runarray62(stack *Stack) { @@ -1801,7 +1816,7 @@ void gen_runarray62(stack *Stack) realarray * c=vm::pop<realarray *>(Stack); realarray * b=vm::pop<realarray *>(Stack); realarray * a=vm::pop<realarray *>(Stack); -#line 1490 "runarray.in" +#line 1506 "runarray.in" size_t n=checkArrays(a,b); checkEqual(n,checkArray(c)); checkEqual(n,checkArray(f)); @@ -1898,7 +1913,7 @@ void gen_runarray62(stack *Stack) } // Root solve by Newton-Raphson -#line 1587 "runarray.in" +#line 1603 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x, bool verbose=false); void gen_runarray63(stack *Stack) { @@ -1907,7 +1922,7 @@ void gen_runarray63(stack *Stack) callableReal * fprime=vm::pop<callableReal *>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); Int iterations=vm::pop<Int>(Stack,100); -#line 1589 "runarray.in" +#line 1605 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; Int i=0; size_t oldPrec=0; @@ -1953,7 +1968,7 @@ void gen_runarray63(stack *Stack) // Root solve by Newton-Raphson bisection // cf. routine rtsafe (Press et al., Numerical Recipes, 1991). -#line 1635 "runarray.in" +#line 1651 "runarray.in" // real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x1, real x2, bool verbose=false); void gen_runarray64(stack *Stack) { @@ -1963,7 +1978,7 @@ void gen_runarray64(stack *Stack) callableReal * fprime=vm::pop<callableReal *>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); Int iterations=vm::pop<Int>(Stack,100); -#line 1637 "runarray.in" +#line 1653 "runarray.in" static const real fuzz=1000.0*DBL_EPSILON; size_t oldPrec=0; if(verbose) @@ -2049,7 +2064,7 @@ void gen_runarray64(stack *Stack) // In this implementation, the binary search is interleaved // with a modified version of quadratic interpolation. // This is a C++ port of the Asymptote routine written by Charles Staats III. -#line 1723 "runarray.in" +#line 1739 "runarray.in" // real _findroot(callableReal *f, real a, real b, real tolerance, real fa, real fb); void gen_runarray65(stack *Stack) { @@ -2059,7 +2074,7 @@ void gen_runarray65(stack *Stack) real b=vm::pop<real>(Stack); real a=vm::pop<real>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); -#line 1725 "runarray.in" +#line 1741 "runarray.in" if(fa == 0.0) {Stack->push<real>(a); return;} if(fb == 0.0) {Stack->push<real>(b); return;} @@ -2151,7 +2166,7 @@ void gen_runarray65(stack *Stack) {Stack->push<real>(a-(b-a)/(fb-fa)*fa); return;} } -#line 1817 "runarray.in" +#line 1833 "runarray.in" // real simpson(callableReal *f, real a, real b, real acc=DBL_EPSILON, real dxmax=0); void gen_runarray66(stack *Stack) { @@ -2160,7 +2175,7 @@ void gen_runarray66(stack *Stack) real b=vm::pop<real>(Stack); real a=vm::pop<real>(Stack); callableReal * f=vm::pop<callableReal *>(Stack); -#line 1819 "runarray.in" +#line 1835 "runarray.in" real integral; if(dxmax <= 0) dxmax=fabs(b-a); callable *oldFunc=Func; @@ -2173,13 +2188,13 @@ void gen_runarray66(stack *Stack) } // Compute the fast Fourier transform of a pair array -#line 1832 "runarray.in" +#line 1848 "runarray.in" // pairarray* fft(pairarray *a, Int sign=1); void gen_runarray67(stack *Stack) { Int sign=vm::pop<Int>(Stack,1); pairarray * a=vm::pop<pairarray *>(Stack); -#line 1833 "runarray.in" +#line 1849 "runarray.in" #ifdef HAVE_LIBFFTW3 unsigned n=(unsigned) checkArray(a); array *c=new array(n); @@ -2209,13 +2224,13 @@ void gen_runarray67(stack *Stack) } // Compute the fast Fourier transform of a 2D pair array -#line 1863 "runarray.in" +#line 1879 "runarray.in" // pairarray2* fft(pairarray2 *a, Int sign=1); void gen_runarray68(stack *Stack) { Int sign=vm::pop<Int>(Stack,1); pairarray2 * a=vm::pop<pairarray2 *>(Stack); -#line 1864 "runarray.in" +#line 1880 "runarray.in" #ifdef HAVE_LIBFFTW3 size_t n=checkArray(a); size_t m=n == 0 ? 0 : checkArray(read<array*>(a,0)); @@ -2260,13 +2275,13 @@ void gen_runarray68(stack *Stack) } // Compute the fast Fourier transform of a 3D pair array -#line 1909 "runarray.in" +#line 1925 "runarray.in" // pairarray3* fft(pairarray3 *a, Int sign=1); void gen_runarray69(stack *Stack) { Int sign=vm::pop<Int>(Stack,1); pairarray3 * a=vm::pop<pairarray3 *>(Stack); -#line 1910 "runarray.in" +#line 1926 "runarray.in" #ifdef HAVE_LIBFFTW3 size_t n=checkArray(a); array *a0=read<array*>(a,0); @@ -2323,12 +2338,120 @@ void gen_runarray69(stack *Stack) {Stack->push<pairarray3*>(c); return;} } -#line 1967 "runarray.in" -// Intarray2* triangulate(pairarray *z); +// Compute the real Schur decomposition of a 2D pair array +#line 1984 "runarray.in" +// realarray3* _schur(realarray2 *a); void gen_runarray70(stack *Stack) { + realarray2 * a=vm::pop<realarray2 *>(Stack); +#line 1985 "runarray.in" +#ifdef HAVE_EIGEN_DENSE + size_t n=checkArray(a); + + MatrixXd A=MatrixXd::Random(n,n); + RealSchur<MatrixXd> schur(n); + + array *S=new array(2); + + if(n) { + for(size_t i=0; i < n; ++i) { + array *ai=read<array *>(a,i); + size_t aisize=checkArray(ai); + if(aisize != n) error(square); + for(size_t j=0; j < n; ++j) + A(i,j)=read<double>(ai,j); + } + + schur.compute(A); + MatrixXd U=schur.matrixU(); + MatrixXd T=schur.matrixT(); + + array *u=new array(n); + array *t=new array(n); + (*S)[0]=u; + (*S)[1]=t; + + for(size_t i=0; i < n; ++i) { + array *ui=new array(n); + array *ti=new array(n); + (*u)[i]=ui; + (*t)[i]=ti; + for(size_t j=0; j < n; ++j) { + (*ui)[j]=U(i,j); + (*ti)[j]=T(i,j); + } + } + } +#else + unused(a); + array *S=new array(0); + error(installEIGEN); +#endif // HAVE_EIGEN_DENSE + {Stack->push<realarray3*>(S); return;} +} + +// Compute the Schur decomposition of a 2D pair array +#line 2032 "runarray.in" +// pairarray3* _schur(pairarray2 *a); +void gen_runarray71(stack *Stack) +{ + pairarray2 * a=vm::pop<pairarray2 *>(Stack); +#line 2033 "runarray.in" +#ifdef HAVE_EIGEN_DENSE + size_t n=checkArray(a); + + MatrixXcd A=MatrixXcd::Random(n,n); + ComplexSchur<MatrixXcd> schur(n); + + array *S=new array(2); + + if(n) { + for(size_t i=0; i < n; ++i) { + array *ai=read<array *>(a,i); + size_t aisize=checkArray(ai); + if(aisize != n) error(square); + for(size_t j=0; j < n; ++j) { + pair z=read<pair>(ai,j); + A(i,j)=Complex(z.getx(),z.gety()); + } + } + + schur.compute(A); + MatrixXcd U=schur.matrixU(); + MatrixXcd T=schur.matrixT(); + + array *u=new array(n); + array *t=new array(n); + (*S)[0]=u; + (*S)[1]=t; + + for(size_t i=0; i < n; ++i) { + array *ui=new array(n); + array *ti=new array(n); + (*u)[i]=ui; + (*t)[i]=ti; + for(size_t j=0; j < n; ++j) { + Complex z=U(i,j); + Complex w=T(i,j); + (*ui)[j]=pair(z.real(),z.imag()); + (*ti)[j]=pair(w.real(),w.imag()); + } + } + } +#else + unused(a); + array *S=new array(0); + error(installEIGEN); +#endif // HAVE_EIGEN_DENSE + {Stack->push<pairarray3*>(S); return;} +} + +#line 2083 "runarray.in" +// Intarray2* triangulate(pairarray *z); +void gen_runarray72(stack *Stack) +{ pairarray * z=vm::pop<pairarray *>(Stack); -#line 1968 "runarray.in" +#line 2084 "runarray.in" size_t nv=checkArray(z); // Call robust version of Gilles Dumoulin's port of Paul Bourke's // triangulation code. @@ -2362,12 +2485,12 @@ void gen_runarray70(stack *Stack) {Stack->push<Intarray2*>(t); return;} } -#line 2002 "runarray.in" +#line 2118 "runarray.in" // real norm(realarray *a); -void gen_runarray71(stack *Stack) +void gen_runarray73(stack *Stack) { realarray * a=vm::pop<realarray *>(Stack); -#line 2003 "runarray.in" +#line 2119 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2377,12 +2500,12 @@ void gen_runarray71(stack *Stack) {Stack->push<real>(M); return;} } -#line 2013 "runarray.in" +#line 2129 "runarray.in" // real norm(realarray2 *a); -void gen_runarray72(stack *Stack) +void gen_runarray74(stack *Stack) { realarray2 * a=vm::pop<realarray2 *>(Stack); -#line 2014 "runarray.in" +#line 2130 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2396,12 +2519,12 @@ void gen_runarray72(stack *Stack) {Stack->push<real>(M); return;} } -#line 2028 "runarray.in" +#line 2144 "runarray.in" // real norm(triplearray2 *a); -void gen_runarray73(stack *Stack) +void gen_runarray75(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 2029 "runarray.in" +#line 2145 "runarray.in" size_t n=checkArray(a); real M=0.0; for(size_t i=0; i < n; ++i) { @@ -2415,12 +2538,12 @@ void gen_runarray73(stack *Stack) {Stack->push<real>(sqrt(M)); return;} } -#line 2043 "runarray.in" +#line 2159 "runarray.in" // real change2(triplearray2 *a); -void gen_runarray74(stack *Stack) +void gen_runarray76(stack *Stack) { triplearray2 * a=vm::pop<triplearray2 *>(Stack); -#line 2044 "runarray.in" +#line 2160 "runarray.in" size_t n=checkArray(a); if(n == 0) {Stack->push<real>(0.0); return;} @@ -2441,13 +2564,13 @@ void gen_runarray74(stack *Stack) {Stack->push<real>(M); return;} } -#line 2065 "runarray.in" +#line 2181 "runarray.in" // triple minbezier(triplearray2 *P, triple b); -void gen_runarray75(stack *Stack) +void gen_runarray77(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 2066 "runarray.in" +#line 2182 "runarray.in" size_t N; real *A=copyTripleArray2Components(P,N); bound_double *B=bounddouble(N); @@ -2458,13 +2581,13 @@ void gen_runarray75(stack *Stack) {Stack->push<triple>(b); return;} } -#line 2077 "runarray.in" +#line 2193 "runarray.in" // triple maxbezier(triplearray2 *P, triple b); -void gen_runarray76(stack *Stack) +void gen_runarray78(stack *Stack) { triple b=vm::pop<triple>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 2078 "runarray.in" +#line 2194 "runarray.in" size_t N; real *A=copyTripleArray2Components(P,N); bound_double *B=bounddouble(N); @@ -2475,13 +2598,13 @@ void gen_runarray76(stack *Stack) {Stack->push<triple>(b); return;} } -#line 2089 "runarray.in" +#line 2205 "runarray.in" // pair minratio(triplearray2 *P, pair b); -void gen_runarray77(stack *Stack) +void gen_runarray79(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 2090 "runarray.in" +#line 2206 "runarray.in" size_t N; triple *A=copyTripleArray2C(P,N); real fuzz=Fuzz*norm(A,N); @@ -2492,13 +2615,13 @@ void gen_runarray77(stack *Stack) {Stack->push<pair>(b); return;} } -#line 2101 "runarray.in" +#line 2217 "runarray.in" // pair maxratio(triplearray2 *P, pair b); -void gen_runarray78(stack *Stack) +void gen_runarray80(stack *Stack) { pair b=vm::pop<pair>(Stack); triplearray2 * P=vm::pop<triplearray2 *>(Stack); -#line 2102 "runarray.in" +#line 2218 "runarray.in" size_t N; triple *A=copyTripleArray2C(P,N); bound_triple *B=boundtriple(N); @@ -2509,11 +2632,11 @@ void gen_runarray78(stack *Stack) {Stack->push<pair>(b); return;} } -#line 2113 "runarray.in" +#line 2229 "runarray.in" // realarray* _projection(); -void gen_runarray79(stack *Stack) +void gen_runarray81(stack *Stack) { -#line 2114 "runarray.in" +#line 2230 "runarray.in" #ifdef HAVE_GL array *a=new array(14); gl::projection P=gl::camera(); @@ -2550,166 +2673,170 @@ namespace trans { void gen_runarray_venv(venv &ve) { -#line 593 "runarray.in" +#line 609 "runarray.in" REGISTER_BLTIN(run::emptyArray,"emptyArray"); -#line 599 "runarray.in" +#line 615 "runarray.in" REGISTER_BLTIN(run::newDeepArray,"newDeepArray"); -#line 621 "runarray.in" +#line 637 "runarray.in" REGISTER_BLTIN(run::newInitializedArray,"newInitializedArray"); -#line 636 "runarray.in" - REGISTER_BLTIN(run::newAppendedArray,"newAppendedArray"); #line 652 "runarray.in" + REGISTER_BLTIN(run::newAppendedArray,"newAppendedArray"); +#line 668 "runarray.in" REGISTER_BLTIN(run::copyArrayValue,"copyArrayValue"); -#line 664 "runarray.in" +#line 680 "runarray.in" REGISTER_BLTIN(run::copyArray,"copyArray"); -#line 676 "runarray.in" +#line 692 "runarray.in" REGISTER_BLTIN(run::arrayRead,"arrayRead"); -#line 688 "runarray.in" +#line 704 "runarray.in" REGISTER_BLTIN(run::arraySliceRead,"arraySliceRead"); -#line 695 "runarray.in" +#line 711 "runarray.in" REGISTER_BLTIN(run::arraySliceReadToEnd,"arraySliceReadToEnd"); -#line 703 "runarray.in" +#line 719 "runarray.in" REGISTER_BLTIN(run::arrayArrayRead,"arrayArrayRead"); -#line 712 "runarray.in" +#line 728 "runarray.in" REGISTER_BLTIN(run::arrayWrite,"arrayWrite"); -#line 729 "runarray.in" +#line 745 "runarray.in" REGISTER_BLTIN(run::arraySliceWrite,"arraySliceWrite"); -#line 737 "runarray.in" +#line 753 "runarray.in" REGISTER_BLTIN(run::arraySliceWriteToEnd,"arraySliceWriteToEnd"); -#line 745 "runarray.in" +#line 761 "runarray.in" REGISTER_BLTIN(run::arrayLength,"arrayLength"); -#line 751 "runarray.in" +#line 767 "runarray.in" REGISTER_BLTIN(run::arrayKeys,"arrayKeys"); -#line 766 "runarray.in" +#line 782 "runarray.in" REGISTER_BLTIN(run::arrayCyclicFlag,"arrayCyclicFlag"); -#line 773 "runarray.in" +#line 789 "runarray.in" REGISTER_BLTIN(run::arraySetCyclicFlag,"arraySetCyclicFlag"); -#line 780 "runarray.in" +#line 796 "runarray.in" REGISTER_BLTIN(run::arrayInitializedHelper,"arrayInitializedHelper"); -#line 791 "runarray.in" +#line 807 "runarray.in" REGISTER_BLTIN(run::arrayInitialized,"arrayInitialized"); -#line 797 "runarray.in" +#line 813 "runarray.in" REGISTER_BLTIN(run::arrayCyclicHelper,"arrayCyclicHelper"); -#line 804 "runarray.in" +#line 820 "runarray.in" REGISTER_BLTIN(run::arrayCyclic,"arrayCyclic"); -#line 810 "runarray.in" +#line 826 "runarray.in" REGISTER_BLTIN(run::arrayPushHelper,"arrayPushHelper"); -#line 818 "runarray.in" +#line 834 "runarray.in" REGISTER_BLTIN(run::arrayPush,"arrayPush"); -#line 824 "runarray.in" +#line 840 "runarray.in" REGISTER_BLTIN(run::arrayAppendHelper,"arrayAppendHelper"); -#line 833 "runarray.in" +#line 849 "runarray.in" REGISTER_BLTIN(run::arrayAppend,"arrayAppend"); -#line 839 "runarray.in" +#line 855 "runarray.in" REGISTER_BLTIN(run::arrayPopHelper,"arrayPopHelper"); -#line 848 "runarray.in" +#line 864 "runarray.in" REGISTER_BLTIN(run::arrayPop,"arrayPop"); -#line 854 "runarray.in" +#line 870 "runarray.in" REGISTER_BLTIN(run::arrayInsertHelper,"arrayInsertHelper"); -#line 865 "runarray.in" +#line 881 "runarray.in" REGISTER_BLTIN(run::arrayInsert,"arrayInsert"); -#line 871 "runarray.in" +#line 887 "runarray.in" REGISTER_BLTIN(run::arrayDelete,"arrayDelete"); -#line 877 "runarray.in" +#line 893 "runarray.in" REGISTER_BLTIN(run::arrayAlias,"arrayAlias"); -#line 882 "runarray.in" +#line 898 "runarray.in" REGISTER_BLTIN(run::arrayIntArray,"arrayIntArray"); -#line 900 "runarray.in" +#line 916 "runarray.in" addFunc(ve, run::gen_runarray32, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false)); -#line 919 "runarray.in" +#line 935 "runarray.in" REGISTER_BLTIN(run::arraySequence,"arraySequence"); -#line 932 "runarray.in" +#line 948 "runarray.in" addFunc(ve, run::gen_runarray34, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false)); -#line 943 "runarray.in" +#line 959 "runarray.in" REGISTER_BLTIN(run::arrayFunction,"arrayFunction"); -#line 956 "runarray.in" +#line 972 "runarray.in" REGISTER_BLTIN(run::arraySort,"arraySort"); -#line 966 "runarray.in" +#line 982 "runarray.in" REGISTER_BLTIN(run::arraySearch,"arraySearch"); -#line 985 "runarray.in" +#line 1001 "runarray.in" addFunc(ve, run::gen_runarray38, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false)); -#line 994 "runarray.in" +#line 1010 "runarray.in" addFunc(ve, run::gen_runarray39, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false)); -#line 1003 "runarray.in" +#line 1019 "runarray.in" addFunc(ve, run::gen_runarray40, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false)); -#line 1012 "runarray.in" +#line 1028 "runarray.in" REGISTER_BLTIN(run::arrayConcat,"arrayConcat"); -#line 1040 "runarray.in" +#line 1056 "runarray.in" REGISTER_BLTIN(run::array2Transpose,"array2Transpose"); -#line 1066 "runarray.in" +#line 1082 "runarray.in" REGISTER_BLTIN(run::array3Transpose,"array3Transpose"); -#line 1153 "runarray.in" +#line 1169 "runarray.in" addFunc(ve, run::gen_runarray44, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false)); -#line 1172 "runarray.in" +#line 1188 "runarray.in" addFunc(ve, run::gen_runarray45, IntArray(), SYM(findall), formal(booleanArray(), SYM(a), false, false)); -#line 1185 "runarray.in" +#line 1201 "runarray.in" REGISTER_BLTIN(run::arrayConditional,"arrayConditional"); -#line 1211 "runarray.in" +#line 1227 "runarray.in" addFunc(ve, run::gen_runarray47, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false)); -#line 1217 "runarray.in" +#line 1233 "runarray.in" addFunc(ve, run::gen_runarray48, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false)); -#line 1229 "runarray.in" +#line 1245 "runarray.in" addFunc(ve, run::gen_runarray49, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1282 "runarray.in" +#line 1298 "runarray.in" addFunc(ve, run::gen_runarray50, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false)); -#line 1347 "runarray.in" +#line 1363 "runarray.in" addFunc(ve, run::gen_runarray51, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false)); -#line 1364 "runarray.in" +#line 1380 "runarray.in" addFunc(ve, run::gen_runarray52, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1383 "runarray.in" +#line 1399 "runarray.in" addFunc(ve, run::gen_runarray53, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1412 "runarray.in" +#line 1428 "runarray.in" addFunc(ve, run::gen_runarray54, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false)); -#line 1417 "runarray.in" +#line 1433 "runarray.in" addFunc(ve, run::gen_runarray55, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false)); -#line 1422 "runarray.in" +#line 1438 "runarray.in" addFunc(ve, run::gen_runarray56, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false)); -#line 1427 "runarray.in" +#line 1443 "runarray.in" addFunc(ve, run::gen_runarray57, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false)); -#line 1432 "runarray.in" +#line 1448 "runarray.in" addFunc(ve, run::gen_runarray58, realArray2(), SYM(AtA), formal(realArray2(), SYM(a), false, false)); -#line 1437 "runarray.in" +#line 1453 "runarray.in" addFunc(ve, run::gen_runarray59, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false)); -#line 1462 "runarray.in" +#line 1478 "runarray.in" addFunc(ve, run::gen_runarray60, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false)); -#line 1472 "runarray.in" +#line 1488 "runarray.in" addFunc(ve, run::gen_runarray61, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false)); -#line 1482 "runarray.in" +#line 1498 "runarray.in" addFunc(ve, run::gen_runarray62, realArray(), SYM(tridiagonal), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(realArray(), SYM(c), false, false), formal(realArray(), SYM(f), false, false)); -#line 1586 "runarray.in" +#line 1602 "runarray.in" addFunc(ve, run::gen_runarray63, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x), false, false), formal(primBoolean(), SYM(verbose), true, false)); -#line 1633 "runarray.in" +#line 1649 "runarray.in" addFunc(ve, run::gen_runarray64, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x1), false, false), formal(primReal(), SYM(x2), false, false), formal(primBoolean(), SYM(verbose), true, false)); -#line 1715 "runarray.in" +#line 1731 "runarray.in" addFunc(ve, run::gen_runarray65, primReal(), SYM(_findroot), formal(realRealFunction(), SYM(f), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(tolerance), false, false), formal(primReal(), SYM(fa), false, false), formal(primReal(), SYM(fb), false, false)); -#line 1817 "runarray.in" +#line 1833 "runarray.in" addFunc(ve, run::gen_runarray66, primReal(), SYM(simpson), formal(realRealFunction(), SYM(f), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(acc), true, false), formal(primReal(), SYM(dxmax), true, false)); -#line 1831 "runarray.in" +#line 1847 "runarray.in" addFunc(ve, run::gen_runarray67, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); -#line 1862 "runarray.in" +#line 1878 "runarray.in" addFunc(ve, run::gen_runarray68, pairArray2(), SYM(fft), formal(pairArray2(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); -#line 1908 "runarray.in" +#line 1924 "runarray.in" addFunc(ve, run::gen_runarray69, pairArray3(), SYM(fft), formal(pairArray3(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false)); -#line 1967 "runarray.in" - addFunc(ve, run::gen_runarray70, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); -#line 2002 "runarray.in" - addFunc(ve, run::gen_runarray71, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); -#line 2013 "runarray.in" - addFunc(ve, run::gen_runarray72, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); -#line 2028 "runarray.in" - addFunc(ve, run::gen_runarray73, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); -#line 2043 "runarray.in" - addFunc(ve, run::gen_runarray74, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); -#line 2065 "runarray.in" - addFunc(ve, run::gen_runarray75, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 2077 "runarray.in" - addFunc(ve, run::gen_runarray76, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); -#line 2089 "runarray.in" - addFunc(ve, run::gen_runarray77, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 2101 "runarray.in" - addFunc(ve, run::gen_runarray78, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); -#line 2113 "runarray.in" - addFunc(ve, run::gen_runarray79, realArray(), SYM(_projection)); +#line 1983 "runarray.in" + addFunc(ve, run::gen_runarray70, realArray3(), SYM(_schur), formal(realArray2(), SYM(a), false, false)); +#line 2031 "runarray.in" + addFunc(ve, run::gen_runarray71, pairArray3(), SYM(_schur), formal(pairArray2(), SYM(a), false, false)); +#line 2083 "runarray.in" + addFunc(ve, run::gen_runarray72, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false)); +#line 2118 "runarray.in" + addFunc(ve, run::gen_runarray73, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false)); +#line 2129 "runarray.in" + addFunc(ve, run::gen_runarray74, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false)); +#line 2144 "runarray.in" + addFunc(ve, run::gen_runarray75, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false)); +#line 2159 "runarray.in" + addFunc(ve, run::gen_runarray76, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false)); +#line 2181 "runarray.in" + addFunc(ve, run::gen_runarray77, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); +#line 2193 "runarray.in" + addFunc(ve, run::gen_runarray78, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false)); +#line 2205 "runarray.in" + addFunc(ve, run::gen_runarray79, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); +#line 2217 "runarray.in" + addFunc(ve, run::gen_runarray80, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false)); +#line 2229 "runarray.in" + addFunc(ve, run::gen_runarray81, realArray(), SYM(_projection)); } } // namespace trans diff --git a/graphics/asymptote/runarray.in b/graphics/asymptote/runarray.in index 5e45cfd4bf..fdc28f2d3c 100644 --- a/graphics/asymptote/runarray.in +++ b/graphics/asymptote/runarray.in @@ -12,6 +12,7 @@ Intarray* => IntArray() Intarray2* => IntArray2() realarray* => realArray() realarray2* => realArray2() +realarray3* => realArray3() pairarray* => pairArray() pairarray2* => pairArray2() pairarray3* => pairArray3() @@ -34,6 +35,19 @@ static const char *installFFTW= "Please install fftw3, then ./configure; make"; #endif +#ifdef HAVE_EIGEN_DENSE +#include <Eigen/Dense> +typedef std::complex<double> Complex; +static const char *square="matrix must be square"; +using Eigen::MatrixXd; +using Eigen::MatrixXcd; +using Eigen::RealSchur; +using Eigen::ComplexSchur; +#else +static const char *installEIGEN= + "Please install eigen3, then ./configure; make"; +#endif + using namespace camp; using namespace vm; @@ -46,6 +60,7 @@ typedef array Intarray; typedef array Intarray2; typedef array realarray; typedef array realarray2; +typedef array realarray3; typedef array pairarray; typedef array pairarray2; typedef array pairarray3; @@ -56,6 +71,7 @@ using types::IntArray; using types::IntArray2; using types::realArray; using types::realArray2; +using types::realArray3; using types::pairArray; using types::pairArray2; using types::pairArray3; @@ -1964,6 +1980,106 @@ pairarray3* fft(pairarray3 *a, Int sign=1) return c; } +// Compute the real Schur decomposition of a 2D pair array +realarray3* _schur(realarray2 *a) +{ +#ifdef HAVE_EIGEN_DENSE + size_t n=checkArray(a); + + MatrixXd A=MatrixXd::Random(n,n); + RealSchur<MatrixXd> schur(n); + + array *S=new array(2); + + if(n) { + for(size_t i=0; i < n; ++i) { + array *ai=read<array *>(a,i); + size_t aisize=checkArray(ai); + if(aisize != n) error(square); + for(size_t j=0; j < n; ++j) + A(i,j)=read<double>(ai,j); + } + + schur.compute(A); + MatrixXd U=schur.matrixU(); + MatrixXd T=schur.matrixT(); + + array *u=new array(n); + array *t=new array(n); + (*S)[0]=u; + (*S)[1]=t; + + for(size_t i=0; i < n; ++i) { + array *ui=new array(n); + array *ti=new array(n); + (*u)[i]=ui; + (*t)[i]=ti; + for(size_t j=0; j < n; ++j) { + (*ui)[j]=U(i,j); + (*ti)[j]=T(i,j); + } + } + } +#else + unused(a); + array *S=new array(0); + error(installEIGEN); +#endif // HAVE_EIGEN_DENSE + return S; +} + +// Compute the Schur decomposition of a 2D pair array +pairarray3* _schur(pairarray2 *a) +{ +#ifdef HAVE_EIGEN_DENSE + size_t n=checkArray(a); + + MatrixXcd A=MatrixXcd::Random(n,n); + ComplexSchur<MatrixXcd> schur(n); + + array *S=new array(2); + + if(n) { + for(size_t i=0; i < n; ++i) { + array *ai=read<array *>(a,i); + size_t aisize=checkArray(ai); + if(aisize != n) error(square); + for(size_t j=0; j < n; ++j) { + pair z=read<pair>(ai,j); + A(i,j)=Complex(z.getx(),z.gety()); + } + } + + schur.compute(A); + MatrixXcd U=schur.matrixU(); + MatrixXcd T=schur.matrixT(); + + array *u=new array(n); + array *t=new array(n); + (*S)[0]=u; + (*S)[1]=t; + + for(size_t i=0; i < n; ++i) { + array *ui=new array(n); + array *ti=new array(n); + (*u)[i]=ui; + (*t)[i]=ti; + for(size_t j=0; j < n; ++j) { + Complex z=U(i,j); + Complex w=T(i,j); + (*ui)[j]=pair(z.real(),z.imag()); + (*ti)[j]=pair(w.real(),w.imag()); + } + } + } +#else + unused(a); + array *S=new array(0); + error(installEIGEN); +#endif // HAVE_EIGEN_DENSE + return S; +} + Intarray2 *triangulate(pairarray *z) { size_t nv=checkArray(z); diff --git a/graphics/asymptote/runbacktrace.cc b/graphics/asymptote/runbacktrace.cc index 002debf8f6..14ad27acc8 100644 --- a/graphics/asymptote/runbacktrace.cc +++ b/graphics/asymptote/runbacktrace.cc @@ -43,11 +43,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runfile.cc b/graphics/asymptote/runfile.cc index c9b2554da8..7804565b7e 100644 --- a/graphics/asymptote/runfile.cc +++ b/graphics/asymptote/runfile.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runhistory.cc b/graphics/asymptote/runhistory.cc index f6a9cc8cf9..089807c5a0 100644 --- a/graphics/asymptote/runhistory.cc +++ b/graphics/asymptote/runhistory.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runlabel.cc b/graphics/asymptote/runlabel.cc index 7611a05eb9..6605bc1b84 100644 --- a/graphics/asymptote/runlabel.cc +++ b/graphics/asymptote/runlabel.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); @@ -360,14 +360,13 @@ void gen_runlabel3(stack *Stack) int status=opentex(texname,prefix,!xe); - string pdfname,pdfname2,psname2; + string pdfname,psname2; bool keep=getSetting<bool>("keep"); if(!status) { if(xe) { string psdriver=getSetting<string>("psdriver"); pdfname=auxname(prefix,"pdf"); - pdfname2=auxname(prefix+"_","pdf"); psname2=auxname(prefix+"_","ps"); if(!fs::exists(pdfname)) {Stack->push<patharray2*>(new array(n)); return;} std::ofstream ps(psname.c_str(),std::ios::binary); @@ -375,34 +374,21 @@ void gen_runlabel3(stack *Stack) showpath(ps); - mem::vector<string> pcmd; - pcmd.push_back(getSetting<string>("gs")); - pcmd.push_back("-q"); - pcmd.push_back("-dNOCACHE"); - pcmd.push_back("-dNOPAUSE"); - pcmd.push_back("-dBATCH"); - if(safe) pcmd.push_back("-dSAFER"); - pcmd.push_back("-sDEVICE=pdfwrite"); - pcmd.push_back("-sOutputFile="+pdfname2); - pcmd.push_back(pdfname); - status=System(pcmd,0,true,"gs"); - if(status == 0) { - mem::vector<string> cmd; - cmd.push_back(getSetting<string>("gs")); - cmd.push_back("-q"); - cmd.push_back("-dNOCACHE"); - cmd.push_back("-dNOPAUSE"); - cmd.push_back("-dBATCH"); - if(safe) cmd.push_back("-dSAFER"); - cmd.push_back("-sDEVICE="+psdriver); - cmd.push_back("-sOutputFile="+psname2); - cmd.push_back(pdfname2); - status=System(cmd,0,true,"gs"); - - std::ifstream in(psname2.c_str()); - ps << in.rdbuf(); - ps.close(); - } + mem::vector<string> cmd; + cmd.push_back(getSetting<string>("gs")); + cmd.push_back("-q"); + cmd.push_back("-dNoOutputFonts"); + cmd.push_back("-dNOPAUSE"); + cmd.push_back("-dBATCH"); + if(safe) cmd.push_back("-dSAFER"); + cmd.push_back("-sDEVICE="+psdriver); + cmd.push_back("-sOutputFile="+psname2); + cmd.push_back(pdfname); + status=System(cmd,0,true,"gs"); + + std::ifstream in(psname2.c_str()); + ps << in.rdbuf(); + ps.close(); } else { if(!fs::exists(dviname)) {Stack->push<patharray2*>(new array(n)); return;} mem::vector<string> dcmd; @@ -424,11 +410,7 @@ void gen_runlabel3(stack *Stack) if(!getSetting<bool>("keepaux")) unlink(auxname(prefix,"aux").c_str()); unlink(auxname(prefix,"log").c_str()); - if(xe) { - unlink(pdfname.c_str()); - unlink(pdfname2.c_str()); - } else - unlink(dviname.c_str()); + unlink(xe ? pdfname.c_str() : dviname.c_str()); if(settings::context(texengine)) { unlink(auxname(prefix,"top").c_str()); unlink(auxname(prefix,"tua").c_str()); @@ -439,13 +421,13 @@ void gen_runlabel3(stack *Stack) {Stack->push<patharray2*>(xe ? readpath(psname,keep,0.1) : readpath(psname,keep,0.12,-1.0)); return;} } -#line 367 "runlabel.in" +#line 349 "runlabel.in" // patharray2* textpath(stringarray *s, penarray *p); void gen_runlabel4(stack *Stack) { penarray * p=vm::pop<penarray *>(Stack); stringarray * s=vm::pop<stringarray *>(Stack); -#line 368 "runlabel.in" +#line 350 "runlabel.in" size_t n=checkArrays(s,p); if(n == 0) {Stack->push<patharray2*>(new array(0)); return;} @@ -481,7 +463,7 @@ void gen_runlabel4(stack *Stack) mem::vector<string> cmd2; cmd2.push_back(getSetting<string>("gs")); cmd2.push_back("-q"); - cmd2.push_back("-dNOCACHE"); + cmd2.push_back("-dNoOutputFonts"); cmd2.push_back("-dNOPAUSE"); cmd2.push_back("-dBATCH"); cmd2.push_back("-P"); @@ -518,13 +500,13 @@ void gen_runlabel4(stack *Stack) {Stack->push<patharray2*>(readpath(psname,keep,0.1)); return;} } -#line 441 "runlabel.in" +#line 423 "runlabel.in" // patharray* _strokepath(path g, pen p=CURRENTPEN); void gen_runlabel5(stack *Stack) { pen p=vm::pop<pen>(Stack,CURRENTPEN); path g=vm::pop<path>(Stack); -#line 442 "runlabel.in" +#line 424 "runlabel.in" array *P=new array(0); if(g.size() == 0) {Stack->push<patharray*>(P); return;} @@ -562,9 +544,9 @@ void gen_runlabel_venv(venv &ve) addFunc(ve, run::gen_runlabel2, realArray(), SYM(texsize), formal(primString(), SYM(s), false, false), formal(primPen(), SYM(p), true, false)); #line 243 "runlabel.in" addFunc(ve, run::gen_runlabel3, pathArray2(), SYM(_texpath), formal(stringArray(), SYM(s), false, false), formal(penArray(), SYM(p), false, false)); -#line 367 "runlabel.in" +#line 349 "runlabel.in" addFunc(ve, run::gen_runlabel4, pathArray2(), SYM(textpath), formal(stringArray(), SYM(s), false, false), formal(penArray(), SYM(p), false, false)); -#line 441 "runlabel.in" +#line 423 "runlabel.in" addFunc(ve, run::gen_runlabel5, pathArray(), SYM(_strokepath), formal(primPath(), SYM(g), false, false), formal(primPen(), SYM(p), true, false)); } diff --git a/graphics/asymptote/runlabel.in b/graphics/asymptote/runlabel.in index 4a6a157d08..06354a9045 100644 --- a/graphics/asymptote/runlabel.in +++ b/graphics/asymptote/runlabel.in @@ -285,14 +285,13 @@ patharray2 *_texpath(stringarray *s, penarray *p) int status=opentex(texname,prefix,!xe); - string pdfname,pdfname2,psname2; + string pdfname,psname2; bool keep=getSetting<bool>("keep"); if(!status) { if(xe) { string psdriver=getSetting<string>("psdriver"); pdfname=auxname(prefix,"pdf"); - pdfname2=auxname(prefix+"_","pdf"); psname2=auxname(prefix+"_","ps"); if(!fs::exists(pdfname)) return new array(n); std::ofstream ps(psname.c_str(),std::ios::binary); @@ -300,34 +299,21 @@ patharray2 *_texpath(stringarray *s, penarray *p) showpath(ps); - mem::vector<string> pcmd; - pcmd.push_back(getSetting<string>("gs")); - pcmd.push_back("-q"); - pcmd.push_back("-dNOCACHE"); - pcmd.push_back("-dNOPAUSE"); - pcmd.push_back("-dBATCH"); - if(safe) pcmd.push_back("-dSAFER"); - pcmd.push_back("-sDEVICE=pdfwrite"); - pcmd.push_back("-sOutputFile="+pdfname2); - pcmd.push_back(pdfname); - status=System(pcmd,0,true,"gs"); - if(status == 0) { - mem::vector<string> cmd; - cmd.push_back(getSetting<string>("gs")); - cmd.push_back("-q"); - cmd.push_back("-dNOCACHE"); - cmd.push_back("-dNOPAUSE"); - cmd.push_back("-dBATCH"); - if(safe) cmd.push_back("-dSAFER"); - cmd.push_back("-sDEVICE="+psdriver); - cmd.push_back("-sOutputFile="+psname2); - cmd.push_back(pdfname2); - status=System(cmd,0,true,"gs"); - - std::ifstream in(psname2.c_str()); - ps << in.rdbuf(); - ps.close(); - } + mem::vector<string> cmd; + cmd.push_back(getSetting<string>("gs")); + cmd.push_back("-q"); + cmd.push_back("-dNoOutputFonts"); + cmd.push_back("-dNOPAUSE"); + cmd.push_back("-dBATCH"); + if(safe) cmd.push_back("-dSAFER"); + cmd.push_back("-sDEVICE="+psdriver); + cmd.push_back("-sOutputFile="+psname2); + cmd.push_back(pdfname); + status=System(cmd,0,true,"gs"); + + std::ifstream in(psname2.c_str()); + ps << in.rdbuf(); + ps.close(); } else { if(!fs::exists(dviname)) return new array(n); mem::vector<string> dcmd; @@ -349,11 +335,7 @@ patharray2 *_texpath(stringarray *s, penarray *p) if(!getSetting<bool>("keepaux")) unlink(auxname(prefix,"aux").c_str()); unlink(auxname(prefix,"log").c_str()); - if(xe) { - unlink(pdfname.c_str()); - unlink(pdfname2.c_str()); - } else - unlink(dviname.c_str()); + unlink(xe ? pdfname.c_str() : dviname.c_str()); if(settings::context(texengine)) { unlink(auxname(prefix,"top").c_str()); unlink(auxname(prefix,"tua").c_str()); @@ -401,7 +383,7 @@ patharray2 *textpath(stringarray *s, penarray *p) mem::vector<string> cmd2; cmd2.push_back(getSetting<string>("gs")); cmd2.push_back("-q"); - cmd2.push_back("-dNOCACHE"); + cmd2.push_back("-dNoOutputFonts"); cmd2.push_back("-dNOPAUSE"); cmd2.push_back("-dBATCH"); cmd2.push_back("-P"); diff --git a/graphics/asymptote/runmath.cc b/graphics/asymptote/runmath.cc index 776e45c804..d9ac05bba4 100644 --- a/graphics/asymptote/runmath.cc +++ b/graphics/asymptote/runmath.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); @@ -70,8 +70,6 @@ function *realRealFunction(); #ifdef __CYGWIN__ extern "C" double yn(int, double); extern "C" double jn(int, double); -extern "C" int __signgam; -#define signgam __signgam #endif using namespace camp; @@ -248,233 +246,233 @@ void Srand(Int seed) #endif namespace run { -#line 192 "runmath.in" +#line 190 "runmath.in" // real ^(real x, Int y); void gen_runmath0(stack *Stack) { Int y=vm::pop<Int>(Stack); real x=vm::pop<real>(Stack); -#line 193 "runmath.in" +#line 191 "runmath.in" {Stack->push<real>(pow(x,y)); return;} } -#line 197 "runmath.in" +#line 195 "runmath.in" // pair ^(pair z, Int y); void gen_runmath1(stack *Stack) { Int y=vm::pop<Int>(Stack); pair z=vm::pop<pair>(Stack); -#line 198 "runmath.in" +#line 196 "runmath.in" {Stack->push<pair>(pow(z,y)); return;} } -#line 202 "runmath.in" +#line 200 "runmath.in" // Int quotient(Int x, Int y); void gen_runmath2(stack *Stack) { Int y=vm::pop<Int>(Stack); Int x=vm::pop<Int>(Stack); -#line 203 "runmath.in" +#line 201 "runmath.in" {Stack->push<Int>(quotient<Int>()(x,y)); return;} } -#line 207 "runmath.in" +#line 205 "runmath.in" // Int abs(Int x); void gen_runmath3(stack *Stack) { Int x=vm::pop<Int>(Stack); -#line 208 "runmath.in" +#line 206 "runmath.in" {Stack->push<Int>(Abs(x)); return;} } -#line 212 "runmath.in" +#line 210 "runmath.in" // Int sgn(real x); void gen_runmath4(stack *Stack) { real x=vm::pop<real>(Stack); -#line 213 "runmath.in" +#line 211 "runmath.in" {Stack->push<Int>(sgn(x)); return;} } -#line 217 "runmath.in" +#line 215 "runmath.in" // Int rand(); void gen_runmath5(stack *Stack) { -#line 218 "runmath.in" +#line 216 "runmath.in" if(initializeRandom) Srand(1); {Stack->push<Int>(random()); return;} } -#line 224 "runmath.in" +#line 222 "runmath.in" // void srand(Int seed); void gen_runmath6(stack *Stack) { Int seed=vm::pop<Int>(Stack); -#line 225 "runmath.in" +#line 223 "runmath.in" Srand(seed); } // a random number uniformly distributed in the interval [0,1] -#line 230 "runmath.in" +#line 228 "runmath.in" // real unitrand(); void gen_runmath7(stack *Stack) { -#line 231 "runmath.in" +#line 229 "runmath.in" {Stack->push<real>(((real) random())/RANDOM_MAX); return;} } -#line 235 "runmath.in" +#line 233 "runmath.in" // Int ceil(real x); void gen_runmath8(stack *Stack) { real x=vm::pop<real>(Stack); -#line 236 "runmath.in" +#line 234 "runmath.in" {Stack->push<Int>(Intcast(ceil(x))); return;} } -#line 240 "runmath.in" +#line 238 "runmath.in" // Int floor(real x); void gen_runmath9(stack *Stack) { real x=vm::pop<real>(Stack); -#line 241 "runmath.in" +#line 239 "runmath.in" {Stack->push<Int>(Intcast(floor(x))); return;} } -#line 245 "runmath.in" +#line 243 "runmath.in" // Int round(real x); void gen_runmath10(stack *Stack) { real x=vm::pop<real>(Stack); -#line 246 "runmath.in" +#line 244 "runmath.in" if(validInt(x)) {Stack->push<Int>(Round(x)); return;} integeroverflow(0); } -#line 251 "runmath.in" +#line 249 "runmath.in" // Int Ceil(real x); void gen_runmath11(stack *Stack) { real x=vm::pop<real>(Stack); -#line 252 "runmath.in" +#line 250 "runmath.in" {Stack->push<Int>(Ceil(x)); return;} } -#line 256 "runmath.in" +#line 254 "runmath.in" // Int Floor(real x); void gen_runmath12(stack *Stack) { real x=vm::pop<real>(Stack); -#line 257 "runmath.in" +#line 255 "runmath.in" {Stack->push<Int>(Floor(x)); return;} } -#line 261 "runmath.in" +#line 259 "runmath.in" // Int Round(real x); void gen_runmath13(stack *Stack) { real x=vm::pop<real>(Stack); -#line 262 "runmath.in" +#line 260 "runmath.in" {Stack->push<Int>(Round(Intcap(x))); return;} } -#line 266 "runmath.in" +#line 264 "runmath.in" // real fmod(real x, real y); void gen_runmath14(stack *Stack) { real y=vm::pop<real>(Stack); real x=vm::pop<real>(Stack); -#line 267 "runmath.in" +#line 265 "runmath.in" if (y == 0.0) dividebyzero(); {Stack->push<real>(fmod(x,y)); return;} } -#line 272 "runmath.in" +#line 270 "runmath.in" // real atan2(real y, real x); void gen_runmath15(stack *Stack) { real x=vm::pop<real>(Stack); real y=vm::pop<real>(Stack); -#line 273 "runmath.in" +#line 271 "runmath.in" {Stack->push<real>(atan2(y,x)); return;} } -#line 277 "runmath.in" +#line 275 "runmath.in" // real hypot(real x, real y); void gen_runmath16(stack *Stack) { real y=vm::pop<real>(Stack); real x=vm::pop<real>(Stack); -#line 278 "runmath.in" +#line 276 "runmath.in" {Stack->push<real>(hypot(x,y)); return;} } -#line 282 "runmath.in" +#line 280 "runmath.in" // real remainder(real x, real y); void gen_runmath17(stack *Stack) { real y=vm::pop<real>(Stack); real x=vm::pop<real>(Stack); -#line 283 "runmath.in" +#line 281 "runmath.in" {Stack->push<real>(remainder(x,y)); return;} } -#line 287 "runmath.in" +#line 285 "runmath.in" // real Jn(Int n, real x); void gen_runmath18(stack *Stack) { real x=vm::pop<real>(Stack); Int n=vm::pop<Int>(Stack); -#line 288 "runmath.in" +#line 286 "runmath.in" {Stack->push<real>(jn(n,x)); return;} } -#line 292 "runmath.in" +#line 290 "runmath.in" // real Yn(Int n, real x); void gen_runmath19(stack *Stack) { real x=vm::pop<real>(Stack); Int n=vm::pop<Int>(Stack); -#line 293 "runmath.in" +#line 291 "runmath.in" {Stack->push<real>(yn(n,x)); return;} } -#line 297 "runmath.in" +#line 295 "runmath.in" // real erf(real x); void gen_runmath20(stack *Stack) { real x=vm::pop<real>(Stack); -#line 298 "runmath.in" +#line 296 "runmath.in" {Stack->push<real>(erf(x)); return;} } -#line 302 "runmath.in" +#line 300 "runmath.in" // real erfc(real x); void gen_runmath21(stack *Stack) { real x=vm::pop<real>(Stack); -#line 303 "runmath.in" +#line 301 "runmath.in" {Stack->push<real>(erfc(x)); return;} } -#line 307 "runmath.in" +#line 305 "runmath.in" // Int factorial(Int n); void gen_runmath22(stack *Stack) { Int n=vm::pop<Int>(Stack); -#line 308 "runmath.in" +#line 306 "runmath.in" if(n < 0) error(invalidargument); {Stack->push<Int>(factorial(n)); return;} } -#line 312 "runmath.in" +#line 310 "runmath.in" // Int choose(Int n, Int k); void gen_runmath23(stack *Stack) { Int k=vm::pop<Int>(Stack); Int n=vm::pop<Int>(Stack); -#line 313 "runmath.in" +#line 311 "runmath.in" if(n < 0 || k < 0 || k > n) error(invalidargument); Int f=1; Int r=n-k; @@ -485,12 +483,12 @@ void gen_runmath23(stack *Stack) {Stack->push<Int>(f); return;} } -#line 323 "runmath.in" +#line 321 "runmath.in" // real gamma(real x); void gen_runmath24(stack *Stack) { real x=vm::pop<real>(Stack); -#line 324 "runmath.in" +#line 322 "runmath.in" #ifdef HAVE_TGAMMA {Stack->push<real>(tgamma(x)); return;} #else @@ -499,14 +497,14 @@ void gen_runmath24(stack *Stack) #endif } -#line 333 "runmath.in" +#line 331 "runmath.in" // realarray* quadraticroots(real a, real b, real c); void gen_runmath25(stack *Stack) { real c=vm::pop<real>(Stack); real b=vm::pop<real>(Stack); real a=vm::pop<real>(Stack); -#line 334 "runmath.in" +#line 332 "runmath.in" quadraticroots q(a,b,c); array *roots=new array(q.roots); if(q.roots >= 1) (*roots)[0]=q.t1; @@ -514,14 +512,14 @@ void gen_runmath25(stack *Stack) {Stack->push<realarray*>(roots); return;} } -#line 342 "runmath.in" +#line 340 "runmath.in" // pairarray* quadraticroots(explicit pair a, explicit pair b, explicit pair c); void gen_runmath26(stack *Stack) { pair c=vm::pop<pair>(Stack); pair b=vm::pop<pair>(Stack); pair a=vm::pop<pair>(Stack); -#line 343 "runmath.in" +#line 341 "runmath.in" Quadraticroots q(a,b,c); array *roots=new array(q.roots); if(q.roots >= 1) (*roots)[0]=q.z1; @@ -529,7 +527,7 @@ void gen_runmath26(stack *Stack) {Stack->push<pairarray*>(roots); return;} } -#line 351 "runmath.in" +#line 349 "runmath.in" // realarray* cubicroots(real a, real b, real c, real d); void gen_runmath27(stack *Stack) { @@ -537,7 +535,7 @@ void gen_runmath27(stack *Stack) real c=vm::pop<real>(Stack); real b=vm::pop<real>(Stack); real a=vm::pop<real>(Stack); -#line 352 "runmath.in" +#line 350 "runmath.in" cubicroots q(a,b,c,d); array *roots=new array(q.roots); if(q.roots >= 1) (*roots)[0]=q.t1; @@ -548,98 +546,98 @@ void gen_runmath27(stack *Stack) // Logical operations -#line 363 "runmath.in" +#line 361 "runmath.in" // bool !(bool b); void gen_runmath28(stack *Stack) { bool b=vm::pop<bool>(Stack); -#line 364 "runmath.in" +#line 362 "runmath.in" {Stack->push<bool>(!b); return;} } -#line 369 "runmath.in" +#line 367 "runmath.in" void boolMemEq(stack *Stack) { frame * b=vm::pop<frame *>(Stack); frame * a=vm::pop<frame *>(Stack); -#line 370 "runmath.in" +#line 368 "runmath.in" {Stack->push<bool>(a == b); return;} } -#line 374 "runmath.in" +#line 372 "runmath.in" void boolMemNeq(stack *Stack) { frame * b=vm::pop<frame *>(Stack); frame * a=vm::pop<frame *>(Stack); -#line 375 "runmath.in" +#line 373 "runmath.in" {Stack->push<bool>(a != b); return;} } -#line 379 "runmath.in" +#line 377 "runmath.in" void boolFuncEq(stack *Stack) { callable * b=vm::pop<callable *>(Stack); callable * a=vm::pop<callable *>(Stack); -#line 380 "runmath.in" +#line 378 "runmath.in" {Stack->push<bool>(a->compare(b)); return;} } -#line 384 "runmath.in" +#line 382 "runmath.in" void boolFuncNeq(stack *Stack) { callable * b=vm::pop<callable *>(Stack); callable * a=vm::pop<callable *>(Stack); -#line 385 "runmath.in" +#line 383 "runmath.in" {Stack->push<bool>(!(a->compare(b))); return;} } // Bit operations -#line 391 "runmath.in" +#line 389 "runmath.in" // Int AND(Int a, Int b); void gen_runmath33(stack *Stack) { Int b=vm::pop<Int>(Stack); Int a=vm::pop<Int>(Stack); -#line 392 "runmath.in" +#line 390 "runmath.in" {Stack->push<Int>(a & b); return;} } -#line 397 "runmath.in" +#line 395 "runmath.in" // Int OR(Int a, Int b); void gen_runmath34(stack *Stack) { Int b=vm::pop<Int>(Stack); Int a=vm::pop<Int>(Stack); -#line 398 "runmath.in" +#line 396 "runmath.in" {Stack->push<Int>(a | b); return;} } -#line 402 "runmath.in" +#line 400 "runmath.in" // Int XOR(Int a, Int b); void gen_runmath35(stack *Stack) { Int b=vm::pop<Int>(Stack); Int a=vm::pop<Int>(Stack); -#line 403 "runmath.in" +#line 401 "runmath.in" {Stack->push<Int>(a ^ b); return;} } -#line 407 "runmath.in" +#line 405 "runmath.in" // Int NOT(Int a); void gen_runmath36(stack *Stack) { Int a=vm::pop<Int>(Stack); -#line 408 "runmath.in" +#line 406 "runmath.in" {Stack->push<Int>(~a); return;} } -#line 412 "runmath.in" +#line 410 "runmath.in" // Int CLZ(Int a); void gen_runmath37(stack *Stack) { Int a=vm::pop<Int>(Stack); -#line 413 "runmath.in" +#line 411 "runmath.in" if((unsigned long long) a > 0xFFFFFFFF) {Stack->push<Int>(CLZ((uint32_t) ((unsigned long long) a >> 32))); return;} else { @@ -649,32 +647,32 @@ void gen_runmath37(stack *Stack) } } -#line 423 "runmath.in" +#line 421 "runmath.in" // Int popcount(Int a); void gen_runmath38(stack *Stack) { Int a=vm::pop<Int>(Stack); -#line 424 "runmath.in" +#line 422 "runmath.in" {Stack->push<Int>(popcount(a)); return;} } -#line 428 "runmath.in" +#line 426 "runmath.in" // Int CTZ(Int a); void gen_runmath39(stack *Stack) { Int a=vm::pop<Int>(Stack); -#line 429 "runmath.in" +#line 427 "runmath.in" {Stack->push<Int>(popcount((a&-a)-1)); return;} } // bitreverse a within a word of length bits. -#line 434 "runmath.in" +#line 432 "runmath.in" // Int bitreverse(Int a, Int bits); void gen_runmath40(stack *Stack) { Int bits=vm::pop<Int>(Stack); Int a=vm::pop<Int>(Stack); -#line 435 "runmath.in" +#line 433 "runmath.in" typedef unsigned long long Bitreverse(unsigned long long a); static Bitreverse *B[]={bitreverse8,bitreverse16,bitreverse24,bitreverse32, bitreverse40,bitreverse48,bitreverse56,bitreverse64}; @@ -695,87 +693,87 @@ namespace trans { void gen_runmath_venv(venv &ve) { -#line 192 "runmath.in" +#line 190 "runmath.in" addFunc(ve, run::gen_runmath0, primReal(), SYM_CARET, formal(primReal(), SYM(x), false, false), formal(primInt(), SYM(y), false, false)); -#line 197 "runmath.in" +#line 195 "runmath.in" addFunc(ve, run::gen_runmath1, primPair(), SYM_CARET, formal(primPair(), SYM(z), false, false), formal(primInt(), SYM(y), false, false)); -#line 202 "runmath.in" +#line 200 "runmath.in" addFunc(ve, run::gen_runmath2, primInt(), SYM(quotient), formal(primInt(), SYM(x), false, false), formal(primInt(), SYM(y), false, false)); -#line 207 "runmath.in" +#line 205 "runmath.in" addFunc(ve, run::gen_runmath3, primInt(), SYM(abs), formal(primInt(), SYM(x), false, false)); -#line 212 "runmath.in" +#line 210 "runmath.in" addFunc(ve, run::gen_runmath4, primInt(), SYM(sgn), formal(primReal(), SYM(x), false, false)); -#line 217 "runmath.in" +#line 215 "runmath.in" addFunc(ve, run::gen_runmath5, primInt(), SYM(rand)); -#line 224 "runmath.in" +#line 222 "runmath.in" addFunc(ve, run::gen_runmath6, primVoid(), SYM(srand), formal(primInt(), SYM(seed), false, false)); -#line 229 "runmath.in" +#line 227 "runmath.in" addFunc(ve, run::gen_runmath7, primReal(), SYM(unitrand)); -#line 235 "runmath.in" +#line 233 "runmath.in" addFunc(ve, run::gen_runmath8, primInt(), SYM(ceil), formal(primReal(), SYM(x), false, false)); -#line 240 "runmath.in" +#line 238 "runmath.in" addFunc(ve, run::gen_runmath9, primInt(), SYM(floor), formal(primReal(), SYM(x), false, false)); -#line 245 "runmath.in" +#line 243 "runmath.in" addFunc(ve, run::gen_runmath10, primInt(), SYM(round), formal(primReal(), SYM(x), false, false)); -#line 251 "runmath.in" +#line 249 "runmath.in" addFunc(ve, run::gen_runmath11, primInt(), SYM(Ceil), formal(primReal(), SYM(x), false, false)); -#line 256 "runmath.in" +#line 254 "runmath.in" addFunc(ve, run::gen_runmath12, primInt(), SYM(Floor), formal(primReal(), SYM(x), false, false)); -#line 261 "runmath.in" +#line 259 "runmath.in" addFunc(ve, run::gen_runmath13, primInt(), SYM(Round), formal(primReal(), SYM(x), false, false)); -#line 266 "runmath.in" +#line 264 "runmath.in" addFunc(ve, run::gen_runmath14, primReal(), SYM(fmod), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); -#line 272 "runmath.in" +#line 270 "runmath.in" addFunc(ve, run::gen_runmath15, primReal(), SYM(atan2), formal(primReal(), SYM(y), false, false), formal(primReal(), SYM(x), false, false)); -#line 277 "runmath.in" +#line 275 "runmath.in" addFunc(ve, run::gen_runmath16, primReal(), SYM(hypot), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); -#line 282 "runmath.in" +#line 280 "runmath.in" addFunc(ve, run::gen_runmath17, primReal(), SYM(remainder), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false)); -#line 287 "runmath.in" +#line 285 "runmath.in" addFunc(ve, run::gen_runmath18, primReal(), SYM(Jn), formal(primInt(), SYM(n), false, false), formal(primReal(), SYM(x), false, false)); -#line 292 "runmath.in" +#line 290 "runmath.in" addFunc(ve, run::gen_runmath19, primReal(), SYM(Yn), formal(primInt(), SYM(n), false, false), formal(primReal(), SYM(x), false, false)); -#line 297 "runmath.in" +#line 295 "runmath.in" addFunc(ve, run::gen_runmath20, primReal(), SYM(erf), formal(primReal(), SYM(x), false, false)); -#line 302 "runmath.in" +#line 300 "runmath.in" addFunc(ve, run::gen_runmath21, primReal(), SYM(erfc), formal(primReal(), SYM(x), false, false)); -#line 307 "runmath.in" +#line 305 "runmath.in" addFunc(ve, run::gen_runmath22, primInt(), SYM(factorial), formal(primInt(), SYM(n), false, false)); -#line 312 "runmath.in" +#line 310 "runmath.in" addFunc(ve, run::gen_runmath23, primInt(), SYM(choose), formal(primInt(), SYM(n), false, false), formal(primInt(), SYM(k), false, false)); -#line 323 "runmath.in" +#line 321 "runmath.in" addFunc(ve, run::gen_runmath24, primReal(), SYM(gamma), formal(primReal(), SYM(x), false, false)); -#line 333 "runmath.in" +#line 331 "runmath.in" addFunc(ve, run::gen_runmath25, realArray(), SYM(quadraticroots), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(c), false, false)); -#line 342 "runmath.in" +#line 340 "runmath.in" addFunc(ve, run::gen_runmath26, pairArray(), SYM(quadraticroots), formal(primPair(), SYM(a), false, true), formal(primPair(), SYM(b), false, true), formal(primPair(), SYM(c), false, true)); -#line 351 "runmath.in" +#line 349 "runmath.in" addFunc(ve, run::gen_runmath27, realArray(), SYM(cubicroots), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(d), false, false)); -#line 361 "runmath.in" +#line 359 "runmath.in" addFunc(ve, run::gen_runmath28, primBoolean(), SYM_LOGNOT, formal(primBoolean(), SYM(b), false, false)); -#line 369 "runmath.in" +#line 367 "runmath.in" REGISTER_BLTIN(run::boolMemEq,"boolMemEq"); -#line 374 "runmath.in" +#line 372 "runmath.in" REGISTER_BLTIN(run::boolMemNeq,"boolMemNeq"); -#line 379 "runmath.in" +#line 377 "runmath.in" REGISTER_BLTIN(run::boolFuncEq,"boolFuncEq"); -#line 384 "runmath.in" +#line 382 "runmath.in" REGISTER_BLTIN(run::boolFuncNeq,"boolFuncNeq"); -#line 389 "runmath.in" +#line 387 "runmath.in" addFunc(ve, run::gen_runmath33, primInt(), SYM(AND), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false)); -#line 397 "runmath.in" +#line 395 "runmath.in" addFunc(ve, run::gen_runmath34, primInt(), SYM(OR), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false)); -#line 402 "runmath.in" +#line 400 "runmath.in" addFunc(ve, run::gen_runmath35, primInt(), SYM(XOR), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false)); -#line 407 "runmath.in" +#line 405 "runmath.in" addFunc(ve, run::gen_runmath36, primInt(), SYM(NOT), formal(primInt(), SYM(a), false, false)); -#line 412 "runmath.in" +#line 410 "runmath.in" addFunc(ve, run::gen_runmath37, primInt(), SYM(CLZ), formal(primInt(), SYM(a), false, false)); -#line 423 "runmath.in" +#line 421 "runmath.in" addFunc(ve, run::gen_runmath38, primInt(), SYM(popcount), formal(primInt(), SYM(a), false, false)); -#line 428 "runmath.in" +#line 426 "runmath.in" addFunc(ve, run::gen_runmath39, primInt(), SYM(CTZ), formal(primInt(), SYM(a), false, false)); -#line 433 "runmath.in" +#line 431 "runmath.in" addFunc(ve, run::gen_runmath40, primInt(), SYM(bitreverse), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(bits), false, false)); } diff --git a/graphics/asymptote/runmath.in b/graphics/asymptote/runmath.in index 9b1291cb94..4beba44fc3 100644 --- a/graphics/asymptote/runmath.in +++ b/graphics/asymptote/runmath.in @@ -17,8 +17,6 @@ pairarray* => pairArray() #ifdef __CYGWIN__ extern "C" double yn(int, double); extern "C" double jn(int, double); -extern "C" int __signgam; -#define signgam __signgam #endif using namespace camp; diff --git a/graphics/asymptote/runpair.cc b/graphics/asymptote/runpair.cc index 7ac0c99908..bbae654ec3 100644 --- a/graphics/asymptote/runpair.cc +++ b/graphics/asymptote/runpair.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runpath.cc b/graphics/asymptote/runpath.cc index 069055cb6f..b346cecd73 100644 --- a/graphics/asymptote/runpath.cc +++ b/graphics/asymptote/runpath.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runpath3d.cc b/graphics/asymptote/runpath3d.cc index ed27e19b62..cb80e3b692 100644 --- a/graphics/asymptote/runpath3d.cc +++ b/graphics/asymptote/runpath3d.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runpicture.cc b/graphics/asymptote/runpicture.cc index a85946c710..0cddfbdaf6 100644 --- a/graphics/asymptote/runpicture.cc +++ b/graphics/asymptote/runpicture.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runstring.cc b/graphics/asymptote/runstring.cc index 98f10e08f2..912df0ce34 100644 --- a/graphics/asymptote/runstring.cc +++ b/graphics/asymptote/runstring.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runsystem.cc b/graphics/asymptote/runsystem.cc index 81115dfc59..e9c8c37eec 100644 --- a/graphics/asymptote/runsystem.cc +++ b/graphics/asymptote/runsystem.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runtime.cc b/graphics/asymptote/runtime.cc index 5b6e9ea730..7a6a32d6c1 100644 --- a/graphics/asymptote/runtime.cc +++ b/graphics/asymptote/runtime.cc @@ -54,11 +54,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); @@ -1828,6 +1828,21 @@ void gen_runtime146(stack *Stack) {Stack->push<bool>(t.isIsometry()); return;} } +#line 1217 "runtime.in" +// real bezier(real a, real b, real c, real d, real t); +void gen_runtime147(stack *Stack) +{ + real t=vm::pop<real>(Stack); + real d=vm::pop<real>(Stack); + real c=vm::pop<real>(Stack); + real b=vm::pop<real>(Stack); + real a=vm::pop<real>(Stack); +#line 1218 "runtime.in" + real onemt=1-t; + real onemt2=onemt*onemt; + {Stack->push<real>(onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d)); return;} +} + } // namespace run namespace trans { @@ -2128,6 +2143,8 @@ void gen_runtime_venv(venv &ve) addFunc(ve, run::gen_runtime145, primTransform(), SYM(reflect), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false)); #line 1212 "runtime.in" addFunc(ve, run::gen_runtime146, primBoolean(), SYM(isometry), formal(primTransform(), SYM(t), false, false)); +#line 1217 "runtime.in" + addFunc(ve, run::gen_runtime147, primReal(), SYM(bezier), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(d), false, false), formal(primReal(), SYM(t), false, false)); } } // namespace trans diff --git a/graphics/asymptote/runtime.in b/graphics/asymptote/runtime.in index 1f67200f5d..42ea5dffc8 100644 --- a/graphics/asymptote/runtime.in +++ b/graphics/asymptote/runtime.in @@ -1213,3 +1213,10 @@ bool isometry(transform t) { return t.isIsometry(); } + +real bezier(real a, real b, real c, real d, real t) +{ + real onemt=1-t; + real onemt2=onemt*onemt; + return onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d); +} diff --git a/graphics/asymptote/runtimebase.in b/graphics/asymptote/runtimebase.in index 5f4cd4e458..48c1b1818f 100644 --- a/graphics/asymptote/runtimebase.in +++ b/graphics/asymptote/runtimebase.in @@ -43,11 +43,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/runtriple.cc b/graphics/asymptote/runtriple.cc index eefd6beaae..919f2957f1 100644 --- a/graphics/asymptote/runtriple.cc +++ b/graphics/asymptote/runtriple.cc @@ -42,11 +42,11 @@ using camp::triple; #include <primitives.h> #undef PRIMITIVE -typedef double real; - void unused(void *); namespace run { +typedef double real; + array *copyArray(array *a); array *copyArray2(array *a); array *copyArray3(array *a); diff --git a/graphics/asymptote/settings.cc b/graphics/asymptote/settings.cc index 8c80bace19..355e7ca2ec 100644 --- a/graphics/asymptote/settings.cc +++ b/graphics/asymptote/settings.cc @@ -949,6 +949,7 @@ struct versionOption : public option { bool ssbo=false; bool gsl=false; bool fftw3=false; + bool eigen=false; bool xdr=false; bool curl=false; bool lsp=false; @@ -978,6 +979,10 @@ struct versionOption : public option { fftw3=true; #endif +#ifdef HAVE_EIGEN_DENSE + eigen=true; +#endif + #ifdef HAVE_RPC_RPC_H xdr=true; #endif @@ -1022,6 +1027,7 @@ struct versionOption : public option { feature("SSBO GLSL shader storage buffer objects",ssbo); feature("GSL GNU Scientific Library (special functions)",gsl); feature("FFTW3 Fast Fourier transforms",fftw3); + feature("Eigen Eigenvalue library",eigen); feature("XDR External Data Representation (portable binary file format for V3D)",xdr); feature("CURL URL support",curl); feature("LSP Language Server Protocol",lsp); @@ -1251,7 +1257,9 @@ void initSettings() { "Compress GPU transparent fragment counts", false)); addOption(new IntSetting("GPUlocalSize", 0, "n", - "Compute shader local size", 16)); + "Compute shader local size", 256)); + addOption(new IntSetting("GPUblockSize", 0, "n", + "Compute shader block size", 8)); addOption(new pairSetting("position", 0, "pair", "Initial 3D rendering screen position")); @@ -1454,7 +1462,7 @@ void initSettings() { addOption(new stringSetting("dvipsOptions", 0, "string", "")); addOption(new stringSetting("dvisvgmOptions", 0, "string", "")); addOption(new boolSetting("dvisvgmMultipleFiles", 0, - "dvisvgm supports multiple files", false)); + "dvisvgm supports multiple files", true)); addOption(new stringSetting("convertOptions", 0, "string", "")); addOption(new stringSetting("gsOptions", 0, "string", "")); addOption(new stringSetting("htmlviewerOptions", 0, "string", "")); diff --git a/graphics/asymptote/util.cc b/graphics/asymptote/util.cc index 85e9320cfd..df33e29bff 100644 --- a/graphics/asymptote/util.cc +++ b/graphics/asymptote/util.cc @@ -288,6 +288,10 @@ int System(const mem::vector<string> &command, int quiet, bool wait, if(pid == -1) camp::reportError("Cannot fork process"); +#ifdef __MSDOS__ + wait=true; +#endif + if(pid == 0) { if(interact::interactive) signal(SIGINT,SIG_IGN); if(quiet) { diff --git a/graphics/asymptote/v3dfile.cc b/graphics/asymptote/v3dfile.cc index f281db010d..e800b445df 100644 --- a/graphics/asymptote/v3dfile.cc +++ b/graphics/asymptote/v3dfile.cc @@ -101,8 +101,7 @@ void v3dfile::addColors(prc::RGBAColour const* col, size_t nc) } -void v3dfile::addPatch(triple const* controls, triple const& Min, - triple const& Max, prc::RGBAColour const* c) +void v3dfile::addPatch(triple const* controls, prc::RGBAColour const* c) { getXDRFile() << (c ? v3dtypes::bezierPatchColor : v3dtypes::bezierPatch); addTriples(controls,16); @@ -112,8 +111,8 @@ void v3dfile::addPatch(triple const* controls, triple const& Min, addColors(c,4); } -void v3dfile::addStraightPatch(triple const* controls, triple const& Min, - triple const& Max, prc::RGBAColour const* c) +void v3dfile::addStraightPatch(triple const* controls, + prc::RGBAColour const* c) { getXDRFile() << (c ? v3dtypes::quadColor : v3dtypes::quad); addTriples(controls,4); @@ -123,8 +122,8 @@ void v3dfile::addStraightPatch(triple const* controls, triple const& Min, addColors(c,4); } -void v3dfile::addBezierTriangle(triple const* controls, triple const& Min, - triple const& Max, prc::RGBAColour const* c) +void v3dfile::addBezierTriangle(triple const* controls, + prc::RGBAColour const* c) { getXDRFile() << (c ? v3dtypes::bezierTriangleColor : v3dtypes::bezierTriangle); addTriples(controls,10); @@ -134,8 +133,8 @@ void v3dfile::addBezierTriangle(triple const* controls, triple const& Min, addColors(c,3); } -void v3dfile::addStraightBezierTriangle(triple const* controls, triple const& Min, - triple const& Max, prc::RGBAColour const* c) +void v3dfile::addStraightBezierTriangle(triple const* controls, + prc::RGBAColour const* c) { getXDRFile() << (c ? v3dtypes::triangleColor : v3dtypes::triangle); addTriples(controls,3); @@ -196,7 +195,7 @@ void v3dfile::addDisk(triple const& center, double radius, double const& polar, getXDRFile() << polar << azimuth; } -void v3dfile::addTube(triple const* g, double width, triple const& Min, triple const& Max, bool core) +void v3dfile::addTube(triple const* g, double width, bool core) { getXDRFile() << v3dtypes::tube; for(int i=0; i < 4; ++i) @@ -206,9 +205,11 @@ void v3dfile::addTube(triple const* g, double width, triple const& Min, triple c getXDRFile() << core; } -void v3dfile::addTriangles(size_t nP, triple const* P, size_t nN, triple const* N, size_t nC, prc::RGBAColour const* C, - size_t nI, uint32_t const (* PI)[3], uint32_t const (* NI)[3], uint32_t const (* CI)[3], - triple const& Min, triple const& Max) +void v3dfile::addTriangles(size_t nP, triple const* P, size_t nN, + triple const* N, size_t nC, + prc::RGBAColour const* C, size_t nI, + uint32_t const (* PI)[3], uint32_t const (* NI)[3], + uint32_t const (* CI)[3]) { getXDRFile() << v3dtypes::triangles; getXDRFile() << (uint32_t) nI; @@ -266,21 +267,21 @@ void v3dfile::addIndices(uint32_t const* v) getXDRFile() << v[0] << v[1] << v[2]; } -void v3dfile::addCurve(triple const& z0, triple const& c0, triple const& c1, triple const& z1, triple const& Min, - triple const& Max) +void v3dfile::addCurve(triple const& z0, triple const& c0, triple const& c1, + triple const& z1) { getXDRFile() << v3dtypes::curve << z0 << c0 << c1 << z1; addCenterIndexMat(); } -void v3dfile::addCurve(triple const& z0, triple const& z1, triple const& Min, triple const& Max) +void v3dfile::addCurve(triple const& z0, triple const& z1) { getXDRFile() << v3dtypes::line << z0 << z1; addCenterIndexMat(); } -void v3dfile::addPixel(triple const& z0, double width, triple const& Min, triple const& Max) +void v3dfile::addPixel(triple const& z0, double width) { getXDRFile() << v3dtypes::pixel << z0 << width; getXDRFile() << (uint32_t) materialIndex; diff --git a/graphics/asymptote/v3dfile.h b/graphics/asymptote/v3dfile.h index 5da4072477..4bbfdd7887 100644 --- a/graphics/asymptote/v3dfile.h +++ b/graphics/asymptote/v3dfile.h @@ -98,13 +98,13 @@ public: void writeInit(); void finalize(); - void addPatch(triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + void addPatch(triple const* controls, prc::RGBAColour const* c) override; void addStraightPatch( - triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + triple const* controls, prc::RGBAColour const* c) override; void addBezierTriangle( - triple const* control, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + triple const* control, prc::RGBAColour const* c) override; void addStraightBezierTriangle( - triple const* controls, triple const& Min, triple const& Max, prc::RGBAColour const* c) override; + triple const* controls, prc::RGBAColour const* c) override; #ifdef HAVE_LIBGLM void addMaterial(Material const& mat) override; @@ -118,21 +118,20 @@ public: bool core) override; void addDisk(triple const& center, double radius, double const& polar, const double& azimuth) override; - void addTube(const triple *g, double width, - const triple& Min, const triple& Max, bool core) override; + void addTube(const triple *g, double width, bool core) override; void addTriangles(size_t nP, const triple* P, size_t nN, - const triple* N, size_t nC, const prc::RGBAColour* C, - size_t nI, const uint32_t (*PI)[3], - const uint32_t (*NI)[3], const uint32_t (*CI)[3], - const triple& Min, const triple& Max) override; + const triple* N, size_t nC, const prc::RGBAColour* C, + size_t nI, const uint32_t (*PI)[3], + const uint32_t (*NI)[3], + const uint32_t (*CI)[3]) override; - void addCurve(triple const& z0, triple const& c0, triple const& c1, triple const& z1, triple const& Min, - triple const& Max) override; + void addCurve(triple const& z0, triple const& c0, triple const& c1, + triple const& z1) override; - void addCurve(triple const& z0, triple const& z1, triple const& Min, triple const& Max) override; + void addCurve(triple const& z0, triple const& z1) override; - void addPixel(triple const& z0, double width, triple const& Min, triple const& Max) override; + void addPixel(triple const& z0, double width) override; void precision(int digits) override {} diff --git a/graphics/asymptote/v3dheadertypes.h b/graphics/asymptote/v3dheadertypes.h index 58faf9d401..b1e151c896 100644 --- a/graphics/asymptote/v3dheadertypes.h +++ b/graphics/asymptote/v3dheadertypes.h @@ -1,6 +1,6 @@ // Enum class for v3dheadertypes // AUTO-GENERATED from v3dheadertypes.csv -// Generated at 2022-04-05 20:50:57.435742 +// Generated at 2022-08-06 23:20:07.528444 namespace camp { diff --git a/graphics/asymptote/v3dheadertypes.py b/graphics/asymptote/v3dheadertypes.py index 3a106935e2..5a94f74a8e 100644 --- a/graphics/asymptote/v3dheadertypes.py +++ b/graphics/asymptote/v3dheadertypes.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # Enum class for v3dheadertypes """ AUTO-GENERATED from v3dheadertypes.csv """ -# Generated at 2022-04-05 20:52:21.974841 +# Generated at 2022-08-06 23:21:25.035253 class v3dheadertypes: v3dheadertypes_canvasWidth=1 diff --git a/graphics/asymptote/v3dtypes.h b/graphics/asymptote/v3dtypes.h index 26d008a627..c652e5994e 100644 --- a/graphics/asymptote/v3dtypes.h +++ b/graphics/asymptote/v3dtypes.h @@ -1,6 +1,6 @@ // Enum class for v3dtypes // AUTO-GENERATED from v3dtypes.csv -// Generated at 2022-04-05 20:50:57.434755 +// Generated at 2022-08-06 23:20:07.528496 namespace camp { diff --git a/graphics/asymptote/v3dtypes.py b/graphics/asymptote/v3dtypes.py index 9f35efc282..dc2eaf3f78 100644 --- a/graphics/asymptote/v3dtypes.py +++ b/graphics/asymptote/v3dtypes.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # Enum class for v3dtypes """ AUTO-GENERATED from v3dtypes.csv """ -# Generated at 2022-04-05 20:52:21.960428 +# Generated at 2022-08-06 23:21:24.955697 class v3dtypes: v3dtypes_material=1 diff --git a/graphics/asymptote/webgl/gl.js b/graphics/asymptote/webgl/gl.js index a3b990c385..4f7ee9530e 100644 --- a/graphics/asymptote/webgl/gl.js +++ b/graphics/asymptote/webgl/gl.js @@ -1,53 +1,70 @@ -let P=[]; // Array of Bezier patches, triangles, curves, and pixels -let Materials=[]; // Array of materials -let Lights=[]; // Array of lights -let Centers=[]; // Array of billboard centers -let Background=[1,1,1,1]; // Background color -let Transform; // Transformation matrix T[4][4] that maps back to user -// coordinates, with T[i][j] stored as element 4*i+j. - -let canvasWidth,canvasHeight; // Canvas width, height - -let absolute=false; // true: absolute size; false: scale to canvas -let ibl=false; -let imageURL; -let image; - -let minBound,maxBound; // Scene min,max bounding box corners (3-tuples) -let orthographic; // true: orthographic; false: perspective -let angleOfView; // Field of view angle -let initialZoom; // Initial zoom -let viewportShift=[0,0]; // Viewport shift (for perspective projection) -let viewportMargin; // Margin around viewport (2-tuple) -let webgl2=false; - -let zoomFactor; // Zoom base factor -let zoomPinchFactor; // Zoom pinch factor -let zoomPinchCap; // Zoom pinch limit -let zoomStep; // Zoom power step - -let shiftHoldDistance; // Shift-mode maximum hold distance (pixels) -let shiftWaitTime; // Shift-mode hold time (milliseconds) -let vibrateTime; // Shift-mode vibrate time (milliseconds) - -let canvasWidth0,canvasHeight0; // Initial values -let zoom0; // Adjusted initial zoom +// AsyGL library core -let embedded; // Is image embedded within another window? +(function() { + +document.asy={ + canvasWidth:0, + canvasHeight:0, + absolute:false, // true: absolute size; false: scale to canvas + + minBound:[0,0,0], // Component-wise minimum bounding box corner + maxBound:[0,0,0], // Component-wise maximum bounding box corner + + orthographic:false, // true: orthographic; false: perspective + angleOfView:0, // Field of view angle + initialZoom:0, // Initial zoom + + viewportShift:[0,0], // Viewport shift (for perspective projection) + viewportMargin:[0,0], // Margin around viewport + + background:[], // Background color + + zoomFactor:0, // Zoom base factor + zoomPinchFactor:0, // Zoom pinch factor + zoomPinchCap:0, // Zoom pinch limit + zoomStep:0, // Zoom power step + + shiftHoldDistance:0, // Shift-mode maximum hold distance (pixels) + shiftWaitTime:0, // Shift-mode hold time (milliseconds) + vibrateTime:0, // Shift-mode vibrate time (milliseconds) + + ibl:false, + webgl2:false, + + imageURL:"", + image:"", + + // Transformation matrix T[4][4] that maps back to user + // coordinates, with T[i][j] stored as element 4*i+j. + Transform:[], + + Centers:[] // Array of billboard centers +} + +let W=document.asy; -let canvas; // Rendering canvas let gl; // WebGL rendering context let alpha; // Is background opaque? - +let embedded; // Is image embedded within another window? +let canvas; // Rendering canvas let offscreen; // Offscreen rendering canvas for embedded images let context; // 2D context for copying embedded offscreen images +let P=[]; // Array of Bezier patches, triangles, curves, and pixels +let Lights=[]; // Array of lights +let Materials=[]; // Array of materials + let nlights=0; // Number of lights compiled in shader let Nmaterials=2; // Maximum number of materials compiled in shader let materials=[]; // Subset of Materials passed as uniforms let maxMaterials; // Limit on number of materials allowed in shader +// Initial values: +let canvasWidth0; +let canvasHeight0; +let zoom0; + let halfCanvasWidth,halfCanvasHeight; const pixelResolution=0.75; // Adaptive rendering constant. @@ -57,6 +74,7 @@ const windowTrim=10; const third=1/3; const pi=Math.acos(-1.0); const radians=pi/180.0; +const maxDepth=Math.ceil(1-Math.log2(Number.EPSILON)); let Zoom; let lastZoom; @@ -116,9 +134,9 @@ function IBLReady() function SetIBL() { - if(!embedded) + if(!W.embedded) deleteShaders(); - initShaders(ibl); + initShaders(W.ibl); } let roughnessStepCount=8; @@ -196,7 +214,7 @@ function deleteShaders() function saveAttributes() { - let a=webgl2 ? + let a=W.webgl2 ? window.top.document.asygl2[alpha] : window.top.document.asygl[alpha]; @@ -213,7 +231,7 @@ function saveAttributes() function restoreAttributes() { - let a=webgl2 ? + let a=W.webgl2 ? window.top.document.asygl2[alpha] : window.top.document.asygl[alpha]; @@ -232,18 +250,18 @@ let indexExt; function webGL(canvas,alpha) { let gl; - if(webgl2) { + if(W.webgl2) { gl=canvas.getContext("webgl2",{alpha: alpha}); - if(embedded && !gl) { - webgl2=false; - ibl=false; + if(W.embedded && !gl) { + W.webgl2=false; + W.ibl=false; initGL(false); // Look for an existing webgl context return null; // Skip remainder of parent call } } if(!gl) { - webgl2=false; - ibl=false; + W.webgl2=false; + W.ibl=false; gl=canvas.getContext("webgl",{alpha: alpha}); } if(!gl) @@ -253,24 +271,24 @@ function webGL(canvas,alpha) { function initGL(outer=true) { - if(ibl) webgl2=true; + if(W.ibl) W.webgl2=true; - alpha=Background[3] < 1; + alpha=W.background[3] < 1; - if(embedded) { + if(W.embedded) { let p=window.top.document; - if(outer) context=canvas.getContext("2d"); - offscreen=webgl2 ? p.offscreen2 : p.offscreen; + if(outer) context=W.canvas.getContext("2d"); + offscreen=W.webgl2 ? p.offscreen2 : p.offscreen; if(!offscreen) { offscreen=p.createElement("canvas"); - if(webgl2) + if(W.webgl2) p.offscreen2=offscreen; else p.offscreen=offscreen; } - if(webgl2) { + if(W.webgl2) { if(!p.asygl2) p.asygl2=Array(2); } else { @@ -278,14 +296,14 @@ function initGL(outer=true) p.asygl=Array(2); } - asygl=webgl2 ? p.asygl2 : p.asygl; + asygl=W.webgl2 ? p.asygl2 : p.asygl; if(!asygl[alpha] || !asygl[alpha].gl) { rc=webGL(offscreen,alpha); if(rc) gl=rc; else return; initShaders(); - if(webgl2) + if(W.webgl2) p.asygl2[alpha]={}; else p.asygl[alpha]={}; @@ -299,7 +317,7 @@ function initGL(outer=true) } } } else { - gl=webGL(canvas,alpha); + gl=webGL(W.canvas,alpha); initShaders(); } @@ -316,7 +334,7 @@ function initGL(outer=true) function getShader(gl,shaderScript,type,options=[]) { - let version=webgl2 ? '300 es' : '100'; + let version=W.webgl2 ? '300 es' : '100'; let defines=Array(...options) let macros=[ ['nlights',wireframe == 0 ? Lights.length : 0], @@ -337,13 +355,13 @@ precision mediump float; let extensions=[]; - if(webgl2) + if(W.webgl2) defines.push('WEBGL2'); - if(ibl) + if(W.ibl) macros.push(['ROUGHNESS_STEP_COUNT',roughnessStepCount.toFixed(2)]); - if(orthographic) + if(W.orthographic) defines.push('ORTHOGRAPHIC'); macros_str=macros.map(macro => `#define ${macro[0]} ${macro[1]}`).join('\n') @@ -422,9 +440,9 @@ function drawBuffer(data,shader,indices=data.indices) gl.vertexAttribPointer(materialAttribute,1,gl.SHORT,false,2,0); if(shader == colorShader || shader == transparentShader) { - data.colorsBuffer=registerBuffer(new Uint8Array(data.colors), + data.colorsBuffer=registerBuffer(new Float32Array(data.colors), data.colorsBuffer,copy); - gl.vertexAttribPointer(colorAttribute,4,gl.UNSIGNED_BYTE,true,0,0); + gl.vertexAttribPointer(colorAttribute,4,gl.FLOAT,true,0,0); } data.indicesBuffer=registerBuffer(indexExt ? new Uint32Array(indices) : @@ -633,7 +651,7 @@ class Geometry { if(this.CenterIndex == 0) v=corners(this.Min,this.Max); else { - this.c=Centers[this.CenterIndex-1]; + this.c=W.Centers[this.CenterIndex-1]; v=this.Tcorners(this.Min,this.Max); } @@ -659,7 +677,7 @@ class Geometry { P[i]=this.T(p[i]); } - let s=orthographic ? 1 : this.Min[2]/maxBound[2]; + let s=W.orthographic ? 1 : this.Min[2]/W.maxBound[2]; let res=pixelResolution* Math.hypot(s*(viewParam.xmax-viewParam.xmin), s*(viewParam.ymax-viewParam.ymin))/size2; @@ -673,23 +691,28 @@ class Geometry { } } +function boundPoints(p,m) +{ + let b=p[0]; + let n=p.length; + for(let i=1; i < n; ++i) + b=m(b,p[i]); + return b; +} + class BezierPatch extends Geometry { /** * Constructor for Bezier Patch * @param {*} controlpoints array of 16 control points * @param {*} CenterIndex center index of billboard labels (or 0) * @param {*} MaterialIndex material index (>= 0) - * @param {*} Min bounding box corner - * @param {*} Max bounding box corner * @param {*} colors array of 4 RGBA color arrays */ - constructor(controlpoints,CenterIndex,MaterialIndex,Min,Max,color) { + constructor(controlpoints,CenterIndex,MaterialIndex,color,Min,Max) { super(); this.controlpoints=controlpoints; this.CenterIndex=CenterIndex; this.MaterialIndex=MaterialIndex; - this.Min=Min; - this.Max=Max; this.color=color; let n=controlpoints.length; if(color) { @@ -701,7 +724,13 @@ class BezierPatch extends Geometry { this.vertex=this.transparent ? this.data.Vertex.bind(this.data) : this.data.vertex.bind(this.data); - this.L2norm(this.controlpoints); + + let norm2=this.L2norm2(this.controlpoints); + let fuzz=Math.sqrt(1000*Number.EPSILON*norm2); + this.epsilon=norm2*Number.EPSILON; + + this.Min=Min ? Min : this.Bounds(this.controlpoints,Math.min,fuzz); + this.Max=Max ? Max : this.Bounds(this.controlpoints,Math.max,fuzz); } setMaterialIndex() { @@ -715,15 +744,128 @@ class BezierPatch extends Geometry { } } + cornerbound(p,m) { + let b=m(p[0],p[3]); + b=m(b,p[12]); + return m(b,p[15]); + } + + controlbound(p,m) { + let b=m(p[1],p[2]); + b=m(b,p[4]); + b=m(b,p[5]); + b=m(b,p[6]); + b=m(b,p[7]); + b=m(b,p[8]); + b=m(b,p[9]); + b=m(b,p[10]); + b=m(b,p[11]); + b=m(b,p[13]); + return m(b,p[14]); + } + + bound(p,m,b,fuzz,depth) { + b=m(b,this.cornerbound(p,m)); + if(m(-1.0,1.0)*(b-this.controlbound(p,m)) >= -fuzz || depth == 0) + return b; + + --depth; + fuzz *= 2; + + let c0=new Split(p[0],p[1],p[2],p[3]); + let c1=new Split(p[4],p[5],p[6],p[7]); + let c2=new Split(p[8],p[9],p[10],p[11]); + let c3=new Split(p[12],p[13],p[14],p[15]); + + let c4=new Split(p[0],p[4],p[8],p[12]); + let c5=new Split(c0.m0,c1.m0,c2.m0,c3.m0); + let c6=new Split(c0.m3,c1.m3,c2.m3,c3.m3); + let c7=new Split(c0.m5,c1.m5,c2.m5,c3.m5); + let c8=new Split(c0.m4,c1.m4,c2.m4,c3.m4); + let c9=new Split(c0.m2,c1.m2,c2.m2,c3.m2); + let c10=new Split(p[3],p[7],p[11],p[15]); + + // Check all 4 Bezier subpatches. + let s0=[p[0],c0.m0,c0.m3,c0.m5,c4.m0,c5.m0,c6.m0,c7.m0, + c4.m3,c5.m3,c6.m3,c7.m3,c4.m5,c5.m5,c6.m5,c7.m5]; + b=this.bound(s0,m,b,fuzz,depth); + let s1=[c4.m5,c5.m5,c6.m5,c7.m5,c4.m4,c5.m4,c6.m4,c7.m4, + c4.m2,c5.m2,c6.m2,c7.m2,p[12],c3.m0,c3.m3,c3.m5]; + b=this.bound(s1,m,b,fuzz,depth); + let s2=[c7.m5,c8.m5,c9.m5,c10.m5,c7.m4,c8.m4,c9.m4,c10.m4, + c7.m2,c8.m2,c9.m2,c10.m2,c3.m5,c3.m4,c3.m2,p[15]]; + b=this.bound(s2,m,b,fuzz,depth); + let s3=[c0.m5,c0.m4,c0.m2,p[3],c7.m0,c8.m0,c9.m0,c10.m0, + c7.m3,c8.m3,c9.m3,c10.m3,c7.m5,c8.m5,c9.m5,c10.m5]; + return this.bound(s3,m,b,fuzz,depth); + } + + cornerboundtri(p,m) { + let b=m(p[0],p[6]); + return m(b,p[9]); + } + + controlboundtri(p,m) { + let b=m(p[1],p[2]); + b=m(b,p[3]); + b=m(b,p[4]); + b=m(b,p[5]); + b=m(b,p[7]); + return m(b,p[8]); + } + + boundtri(p,m,b,fuzz,depth) { + b=m(b,this.cornerboundtri(p,m)); + if(m(-1.0,1.0)*(b-this.controlboundtri(p,m)) >= -fuzz || depth == 0) + return b; + + --depth; + fuzz *= 2; + + let s=new Splittri(p); + + let l=[s.l003,s.l102,s.l012,s.l201,s.l111, + s.l021,s.l300,s.l210,s.l120,s.l030]; // left + b=this.boundtri(l,m,b,fuzz,depth); + + let r=[s.l300,s.r102,s.r012,s.r201,s.r111, + s.r021,s.r300,s.r210,s.r120,s.r030]; // right + b=this.boundtri(r,m,b,fuzz,depth); + + let u=[s.l030,s.u102,s.u012,s.u201,s.u111, + s.u021,s.r030,s.u210,s.u120,s.u030]; // up + b=this.boundtri(u,m,b,fuzz,depth); + + let c=[s.r030,s.u201,s.r021,s.u102,s.c111, + s.r012,s.l030,s.l120,s.l210,s.l300]; // center + return this.boundtri(c,m,b,fuzz,depth); + } + + Bounds(p,m,fuzz) { + let b=Array(3); + let n=p.length; + let x=Array(n); + for(let i=0; i < 3; ++i) { + for(let j=0; j < n; ++j) + x[j]=p[j][i]; + if(n == 16) + b[i]=this.bound(x,m,x[0],fuzz,maxDepth) + else if(n == 10) + b[i]=this.boundtri(x,m,x[0],fuzz,maxDepth); + else + b[i]=boundPoints(x,m); + } + return [b[0],b[1],b[2]]; + } + // Render a Bezier patch via subdivision. - L2norm(p) { + L2norm2(p) { let p0=p[0]; - this.epsilon=0; + let norm2=0; let n=p.length; for(let i=1; i < n; ++i) - this.epsilon=Math.max(this.epsilon, - abs2([p[i][0]-p0[0],p[i][1]-p0[1],p[i][2]-p0[2]])); - this.epsilon *= Number.EPSILON + norm2=Math.max(norm2,abs2([p[i][0]-p0[0],p[i][1]-p0[1],p[i][2]-p0[2]])); + return norm2; } processTriangle(p) { @@ -1776,14 +1918,128 @@ class BezierPatch extends Geometry { } } +// Calculate the coefficients of a Bezier derivative divided by 3. +function derivative(z0,c0,c1,z1) +{ + let a=z1-z0+3.0*(c0-c1); + let b=2.0*(z0+c1)-4.0*c0; + let c=c0-z0; + return [a,b,c]; +} + +function goodroot(t) +{ + return 0.0 <= t && t <= 1.0; +} + +// Accurate computation of sqrt(1+x)-1. +function sqrt1pxm1(x) +{ + return x/(Math.sqrt(1.0+x)+1.0); +} + +// Solve for the real roots of the quadratic equation ax^2+bx+c=0. +class quadraticroots { + constructor(a,b,c) { + const Fuzz2=1000*Number.EPSILON; + const Fuzz4=Fuzz2*Fuzz2; + + // Remove roots at numerical infinity. + if(Math.abs(a) <= Fuzz2*Math.abs(b)+Fuzz4*Math.abs(c)) { + if(Math.abs(b) > Fuzz2*Math.abs(c)) { + this.roots=1; + this.t1=-c/b; + } else if(c == 0.0) { + this.roots=1; + this.t1=0.0; + } else { + this.roots=0; + } + } else { + let factor=0.5*b/a; + let denom=b*factor; + if(Math.abs(denom) <= Fuzz2*Math.abs(c)) { + let x=-c/a; + if(x >= 0.0) { + this.roots=2; + this.t2=Math.sqrt(x); + this.t1=-this.t2; + } else + this.roots=0; + } else { + let x=-2.0*c/denom; + if(x > -1.0) { + this.roots=2; + let r2=factor*sqrt1pxm1(x); + let r1=-r2-2.0*factor; + if(r1 <= r2) { + this.t1=r1; + this.t2=r2; + } else { + this.t1=r2; + this.t2=r1; + } + } else if(x == -1.0) { + this.roots=1; + this.t1=this.t2=-factor; + } else + this.roots=0; + } + } + } +} + class BezierCurve extends Geometry { constructor(controlpoints,CenterIndex,MaterialIndex,Min,Max) { super(); this.controlpoints=controlpoints; this.CenterIndex=CenterIndex; this.MaterialIndex=MaterialIndex; - this.Min=Min; - this.Max=Max; + + if(Min && Max) { + this.Min=Min; + this.Max=Max; + } else { + let b=this.Bounds(this.controlpoints); + this.Min=b[0]; + this.Max=b[1]; + } + } + + Bounds(p) { + let b=Array(3); + let B=Array(3); + let n=p.length; + let x=Array(n); + for(let i=0; i < 3; ++i) { + for(let j=0; j < n; ++j) + x[j]=p[j][i]; + let m,M; + m=M=x[0]; + if(n == 4) { + m=Math.min(m,x[3]); + M=Math.max(M,x[3]); + let a=derivative(x[0],x[1],x[2],x[3]); + let q=new quadraticroots(a[0],a[1],a[2]); + if(q.roots != 0 && goodroot(q.t1)) { + let v=bezier(x[0],x[1],x[2],x[3],q.t1); + m=Math.min(m,v); + M=Math.max(M,v); + } + if(q.roots == 2 && goodroot(q.t2)) { + let v=bezier(x[0],x[1],x[2],x[3],q.t2); + m=Math.min(m,v); + M=Math.max(M,v); + } + } else { + let v=x[1]; + m=Math.min(m,v); + M=Math.max(M,v); + } + b[i]=m; + B[i]=M; + } + return [[b[0],b[1],b[2]],[B[0],B[1],B[2]]]; } setMaterialIndex() { @@ -1869,14 +2125,14 @@ class BezierCurve extends Geometry { } class Pixel extends Geometry { - constructor(controlpoint,width,MaterialIndex,Min,Max) { + constructor(controlpoint,width,MaterialIndex) { super(); this.controlpoint=controlpoint; this.width=width; this.CenterIndex=0; this.MaterialIndex=MaterialIndex; - this.Min=Min; - this.Max=Max; + this.Min=controlpoint; + this.Max=controlpoint; } setMaterialIndex() { @@ -1898,12 +2154,12 @@ class Pixel extends Geometry { } class Triangles extends Geometry { - constructor(CenterIndex,MaterialIndex,Min,Max) { + constructor(CenterIndex,MaterialIndex) { super(); this.CenterIndex=CenterIndex; this.MaterialIndex=MaterialIndex; - this.Min=Min; - this.Max=Max; + this.Min=this.Bounds(Positions,Math.min); + this.Max=this.Bounds(Positions,Math.max); this.controlpoints=Positions; this.Normals=Normals; @@ -1916,6 +2172,18 @@ class Triangles extends Geometry { this.transparent=Materials[this.MaterialIndex].diffuse[3] < 1; } + Bounds(p,m) { + let b=Array(3); + let n=p.length; + let x=Array(n); + for(let i=0; i < 3; ++i) { + for(let j=0; j < n; ++j) + x[j]=p[j][i]; + b[i]=boundPoints(x,m); + } + return [b[0],b[1],b[2]]; + } + setMaterialIndex() { if(this.transparent) this.setMaterial(transparentData,drawTransparent); @@ -2036,6 +2304,17 @@ function initShader(options=[]) return shader; } +class Split { + constructor(z0,c0,c1,z1) { + this.m0=0.5*(z0+c0); + let m1=0.5*(c0+c1); + this.m2=0.5*(c1+z1); + this.m3=0.5*(this.m0+m1); + this.m4=0.5*(m1+this.m2); + this.m5=0.5*(this.m3+this.m4); + } +} + class Split3 { constructor(z0,c0,c1,z1) { this.m0=[0.5*(z0[0]+c0[0]),0.5*(z0[1]+c0[1]),0.5*(z0[2]+c0[2])]; @@ -2052,6 +2331,65 @@ class Split3 { } } +class Splittri { + constructor(p) { + this.l003=p[0]; + let p102=p[1]; + let p012=p[2]; + let p201=p[3]; + let p111=p[4]; + let p021=p[5]; + this.r300=p[6]; + let p210=p[7]; + let p120=p[8]; + this.u030=p[9]; + + this.u021=0.5*(this.u030+p021); + this.u120=0.5*(this.u030+p120); + + let p033=0.5*(p021+p012); + let p231=0.5*(p120+p111); + let p330=0.5*(p120+p210); + + let p123=0.5*(p012+p111); + + this.l012=0.5*(p012+this.l003); + let p312=0.5*(p111+p201); + this.r210=0.5*(p210+this.r300); + + this.l102=0.5*(this.l003+p102); + let p303=0.5*(p102+p201); + this.r201=0.5*(p201+this.r300); + + this.u012=0.5*(this.u021+p033); + this.u210=0.5*(this.u120+p330); + this.l021=0.5*(p033+this.l012); + let p4xx=0.5*p231+0.25*(p111+p102); + this.r120=0.5*(p330+this.r210); + let px4x=0.5*p123+0.25*(p111+p210); + let pxx4=0.25*(p021+p111)+0.5*p312; + this.l201=0.5*(this.l102+p303); + this.r102=0.5*(p303+this.r201); + + this.l210=0.5*(px4x+this.l201); // = m120 + this.r012=0.5*(px4x+this.r102); // = m021 + this.l300=0.5*(this.l201+this.r102); // = r003 = m030 + + this.r021=0.5*(pxx4+this.r120); // = m012 + this.u201=0.5*(this.u210+pxx4); // = m102 + this.r030=0.5*(this.u210+this.r120); // = u300 = m003 + + this.u102=0.5*(this.u012+p4xx); // = m201 + this.l120=0.5*(this.l021+p4xx); // = m210 + this.l030=0.5*(this.u012+this.l021); // = u003 = m300 + + this.l111=0.5*(p123+this.l102); + this.r111=0.5*(p312+this.r210); + this.u111=0.5*(this.u021+p231); + this.c111=0.25*(p033+p330+p303+p111); + } +} + function unit(v) { let norm=1/(Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]) || 1); @@ -2075,6 +2413,14 @@ function cross(u,v) u[0]*v[1]-u[1]*v[0]]; } +// Evaluate the Bezier curve defined by a,b,c,d at t. +function bezier(a,b,c,d,t) +{ + let onemt=1-t; + let onemt2=onemt*onemt; + return onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d); +} + // Return one-third of the first derivative of the Bezier curve defined // by a,b,c,d at t=0. function bezierP(a,b) @@ -2283,7 +2629,7 @@ function shiftScene(lastX,lastY,rawX,rawY) function panScene(lastX,lastY,rawX,rawY) { - if(orthographic) { + if(W.orthographic) { shiftScene(lastX,lastY,rawX,rawY); } else { center.x += (rawX-lastX)*(viewParam.xmax-viewParam.xmin); @@ -2315,11 +2661,11 @@ function capzoom() function zoomImage(diff) { - let stepPower=zoomStep*halfCanvasHeight*diff; - const limit=Math.log(0.1*Number.MAX_VALUE)/Math.log(zoomFactor); + let stepPower=W.zoomStep*halfCanvasHeight*diff; + const limit=Math.log(0.1*Number.MAX_VALUE)/Math.log(W.zoomFactor); if(Math.abs(stepPower) < limit) { - Zoom *= zoomFactor**stepPower; + Zoom *= W.zoomFactor**stepPower; capzoom(); } } @@ -2403,13 +2749,13 @@ let zoomEnabled=0; function enableZoom() { zoomEnabled=1; - canvas.addEventListener("wheel",handleMouseWheel,false); + W.canvas.addEventListener("wheel",handleMouseWheel,false); } function disableZoom() { zoomEnabled=0; - canvas.removeEventListener("wheel",handleMouseWheel,false); + W.canvas.removeEventListener("wheel",handleMouseWheel,false); } function Camera() @@ -2431,7 +2777,7 @@ function Camera() let R1=rotMat[j4+1]; let R2=rotMat[j4+2]; let R3=rotMat[j4+3]; - let T4ij=Transform[i4+j]; + let T4ij=W.Transform[i4+j]; sumCamera += T4ij*(R3-cx*R0-cy*R1-cz*R2); sumUp += T4ij*R1; sumTarget += T4ij*(R3-cx*R0-cy*R1); @@ -2445,30 +2791,28 @@ function Camera() function projection() { - if(Transform == null) return ""; - let camera,up,target; [camera,up,target]=Camera(); - let projection=orthographic ? " orthographic(" : " perspective("; + let projection=W.orthographic ? " orthographic(" : " perspective("; let indent="".padStart(projection.length); let currentprojection="currentprojection="+"\n"+ projection+"camera=("+camera+"),\n"+ indent+"up=("+up+"),"+"\n"+ indent+"target=("+target+"),"+"\n"+ - indent+"zoom="+Zoom*initialZoom/zoom0; + indent+"zoom="+Zoom*W.initialZoom/W.zoom0; - if(!orthographic) + if(!W.orthographic) currentprojection += ","+"\n" +indent+"angle="+ - 2.0*Math.atan(Math.tan(0.5*angleOfView)/Zoom)/radians; + 2.0*Math.atan(Math.tan(0.5*W.angleOfView)/Zoom)/radians; if(xshift != 0 || yshift != 0) currentprojection += ","+"\n"+ indent+"viewportshift=("+xshift+","+yshift+")"; - if(!orthographic) + if(!W.orthographic) currentprojection += ","+"\n"+ indent+"autoadjust=false"; @@ -2485,7 +2829,7 @@ function handleKey(event) if(!zoomEnabled) enableZoom(); - if(embedded && zoomEnabled && event.keyCode == ESC) { + if(W.embedded && zoomEnabled && event.keyCode == ESC) { disableZoom(); return; } @@ -2510,9 +2854,9 @@ function handleKey(event) ++wireframe; if(wireframe == 3) wireframe=0; if(wireframe != 2) { - if(!embedded) + if(!W.embedded) deleteShaders(); - initShaders(ibl); + initShaders(W.ibl); } remesh=true; drawScene(); @@ -2553,9 +2897,9 @@ function handleMouseWheel(event) event.preventDefault(); if(event.deltaY < 0) { - Zoom *= zoomFactor; + Zoom *= W.zoomFactor; } else { - Zoom /= zoomFactor; + Zoom /= W.zoomFactor; } setZoom(); @@ -2599,12 +2943,12 @@ function handleTouchMove(event) let newY=touches[0].pageY; let dx=newX-lastMouseX; let dy=newY-lastMouseY; - let stationary=dx*dx+dy*dy <= shiftHoldDistance*shiftHoldDistance; + let stationary=dx*dx+dy*dy <= W.shiftHoldDistance*W.shiftHoldDistance; if(stationary) { if(!swipe && !rotate && - new Date().getTime()-touchStartTime > shiftWaitTime) { + new Date().getTime()-touchStartTime > W.shiftWaitTime) { if(navigator.vibrate) - window.navigator.vibrate(vibrateTime); + window.navigator.vibrate(W.vibrateTime); swipe=true; } } @@ -2623,9 +2967,9 @@ function handleTouchMove(event) let distance=pinchDistance(touches); let diff=distance-pinchStart; zooming=true; - diff *= zoomPinchFactor; - if(diff > zoomPinchCap) diff=zoomPinchCap; - if(diff < -zoomPinchCap) diff=-zoomPinchCap; + diff *= W.zoomPinchFactor; + if(diff > W.zoomPinchCap) diff=W.zoomPinchCap; + if(diff < -W.zoomPinchCap) diff=-W.zoomPinchCap; zoomImage(diff/size2); pinchStart=distance; swipe=rotate=zooming=false; @@ -2740,22 +3084,22 @@ function drawBuffers() function drawScene() { - if(embedded) { - offscreen.width=canvasWidth; - offscreen.height=canvasHeight; + if(W.embedded) { + offscreen.width=W.canvasWidth; + offscreen.height=W.canvasHeight; setViewport(); } - gl.clearColor(Background[0],Background[1],Background[2],Background[3]); + gl.clearColor(W.background[0],W.background[1],W.background[2],W.background[3]); gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); - for(let i=0; i < P.length; ++i) - P[i].render(); + for(const p of P) + p.render(); drawBuffers(); - if(embedded) { - context.clearRect(0,0,canvasWidth,canvasHeight); + if(W.embedded) { + context.clearRect(0,0,W.canvasWidth,W.canvasHeight); context.drawImage(offscreen,0,0); } @@ -2765,26 +3109,26 @@ function drawScene() function setDimensions(width,height,X,Y) { let Aspect=width/height; - xshift=(X/width+viewportShift[0])*Zoom; - yshift=(Y/height+viewportShift[1])*Zoom; + xshift=(X/width+W.viewportShift[0])*Zoom; + yshift=(Y/height+W.viewportShift[1])*Zoom; let Zoominv=1/Zoom; - if(orthographic) { - let xsize=maxBound[0]-minBound[0]; - let ysize=maxBound[1]-minBound[1]; + if(W.orthographic) { + let xsize=W.maxBound[0]-W.minBound[0]; + let ysize=W.maxBound[1]-W.minBound[1]; if(xsize < ysize*Aspect) { let r=0.5*ysize*Aspect*Zoominv; let X0=2*r*xshift; let Y0=ysize*Zoominv*yshift; viewParam.xmin=-r-X0; viewParam.xmax=r-X0; - viewParam.ymin=minBound[1]*Zoominv-Y0; - viewParam.ymax=maxBound[1]*Zoominv-Y0; + viewParam.ymin=W.minBound[1]*Zoominv-Y0; + viewParam.ymax=W.maxBound[1]*Zoominv-Y0; } else { let r=0.5*xsize*Zoominv/Aspect; let X0=xsize*Zoominv*xshift; let Y0=2*r*yshift; - viewParam.xmin=minBound[0]*Zoominv-X0; - viewParam.xmax=maxBound[0]*Zoominv-X0; + viewParam.xmin=W.minBound[0]*Zoominv-X0; + viewParam.xmax=W.maxBound[0]*Zoominv-X0; viewParam.ymin=-r-Y0; viewParam.ymax=r-Y0; } @@ -2802,8 +3146,8 @@ function setDimensions(width,height,X,Y) function setProjection() { - setDimensions(canvasWidth,canvasHeight,shift.x,shift.y); - let f=orthographic ? mat4.ortho : mat4.frustum; + setDimensions(W.canvasWidth,W.canvasHeight,shift.x,shift.y); + let f=W.orthographic ? mat4.ortho : mat4.frustum; f(projMat,viewParam.xmin,viewParam.xmax, viewParam.ymin,viewParam.ymax, -viewParam.zmax,-viewParam.zmin); @@ -2822,37 +3166,37 @@ function showCamera() function initProjection() { - H=-Math.tan(0.5*angleOfView)*maxBound[2]; + H=-Math.tan(0.5*W.angleOfView)*W.maxBound[2]; center.x=center.y=0; - center.z=0.5*(minBound[2]+maxBound[2]); - lastZoom=Zoom=zoom0; + center.z=0.5*(W.minBound[2]+W.maxBound[2]); + lastZoom=Zoom=W.zoom0; - viewParam.zmin=minBound[2]; - viewParam.zmax=maxBound[2]; + viewParam.zmin=W.minBound[2]; + viewParam.zmax=W.maxBound[2]; shift.x=shift.y=0; } function setViewport() { - gl.viewportWidth=canvasWidth; - gl.viewportHeight=canvasHeight; - gl.viewport(0.5*(canvas.width-canvasWidth),0.5*(canvas.height-canvasHeight), - canvasWidth,canvasHeight); - gl.scissor(0,0,canvas.width,canvas.height); + gl.viewportWidth=W.canvasWidth; + gl.viewportHeight=W.canvasHeight; + gl.viewport(0.5*(W.canvas.width-W.canvasWidth),0.5*(W.canvas.height-W.canvasHeight), + W.canvasWidth,W.canvasHeight); + gl.scissor(0,0,W.canvas.width,W.canvas.height); } function setCanvas() { - if(embedded) { - canvas.width=offscreen.width=canvasWidth; - canvas.height=offscreen.height=canvasHeight; + if(W.embedded) { + W.canvas.width=offscreen.width=W.canvasWidth; + W.canvas.height=offscreen.height=W.canvasHeight; } - size2=Math.hypot(canvasWidth,canvasHeight); - halfCanvasWidth=0.5*canvas.width; - halfCanvasHeight=0.5*canvas.height; - ArcballFactor=1+8*Math.hypot(viewportMargin[0],viewportMargin[1])/size2; + size2=Math.hypot(W.canvasWidth,W.canvasHeight); + halfCanvasWidth=0.5*W.canvas.width; + halfCanvasHeight=0.5*W.canvas.height; + ArcballFactor=1+8*Math.hypot(W.viewportMargin[0],W.viewportMargin[1])/size2; } function setsize(w,h) @@ -2863,11 +3207,11 @@ function setsize(w,h) if(h > maxViewportHeight) h=maxViewportHeight; - shift.x *= w/canvasWidth; - shift.y *= h/canvasHeight; + shift.x *= w/W.canvasWidth; + shift.y *= h/W.canvasHeight; - canvasWidth=w; - canvasHeight=h; + W.canvasWidth=w; + W.canvasHeight=h; setCanvas(); setViewport(); @@ -2877,48 +3221,48 @@ function setsize(w,h) function resize() { - zoom0=initialZoom; + W.zoom0=W.initialZoom; if(window.top.asyWebApplication && window.top.asyWebApplication.getProjection() == "") window.parent.asyProjection=false; - if(absolute && !embedded) { - canvasWidth=canvasWidth0*window.devicePixelRatio; - canvasHeight=canvasHeight0*window.devicePixelRatio; + if(W.absolute && !W.embedded) { + W.canvasWidth=W.canvasWith0*window.devicePixelRatio; + W.canvasHeight=W.canvasHeight0*window.devicePixelRatio; } else { - let Aspect=canvasWidth0/canvasHeight0; - canvasWidth=Math.max(window.innerWidth-windowTrim,windowTrim); - canvasHeight=Math.max(window.innerHeight-windowTrim,windowTrim); + let Aspect=W.canvasWith0/W.canvasHeight0; + W.canvasWidth=Math.max(window.innerWidth-windowTrim,windowTrim); + W.canvasHeight=Math.max(window.innerHeight-windowTrim,windowTrim); - if(!orthographic && !window.parent.asyProjection && - canvasWidth < canvasHeight*Aspect) - zoom0 *= canvasWidth/(canvasHeight*Aspect); + if(!W.orthographic && !window.parent.asyProjection && + W.canvasWidth < W.canvasHeight*Aspect) + W.zoom0 *= W.canvasWidth/(W.canvasHeight*Aspect); } - canvas.width=canvasWidth; - canvas.height=canvasHeight; + W.canvas.width=W.canvasWidth; + W.canvas.height=W.canvasHeight; let maxViewportWidth=window.innerWidth; let maxViewportHeight=window.innerHeight; - let Zoominv=1/zoom0; - viewportShift[0] *= Zoominv; - viewportShift[1] *= Zoominv; + let Zoominv=1/W.zoom0; + W.viewportShift[0] *= Zoominv; + W.viewportShift[1] *= Zoominv; - setsize(canvasWidth,canvasHeight); + setsize(W.canvasWidth,W.canvasHeight); redrawScene(); } function expand() { - Zoom *= zoomFactor; + Zoom *= W.zoomFactor; setZoom(); } function shrink() { - Zoom /= zoomFactor; + Zoom /= W.zoomFactor; setZoom(); } @@ -2961,31 +3305,35 @@ function Tcorners(T,m,M) return [minbound(v),maxbound(v)]; } +function light(direction,color) +{ + Lights.push(new Light(direction,color)); +} + function material(diffuse,emissive,specular,shininess,metallic,fresnel0) { Materials.push(new Material(diffuse,emissive,specular,shininess,metallic, fresnel0)); } -function patch(controlpoints,CenterIndex,MaterialIndex,Min,Max,color) +function patch(controlpoints,CenterIndex,MaterialIndex,color) { - P.push(new BezierPatch(controlpoints,CenterIndex,MaterialIndex,Min,Max, - color)); + P.push(new BezierPatch(controlpoints,CenterIndex,MaterialIndex,color)); } -function curve(controlpoints,CenterIndex,MaterialIndex,Min,Max) +function curve(controlpoints,CenterIndex,MaterialIndex) { - P.push(new BezierCurve(controlpoints,CenterIndex,MaterialIndex,Min,Max)); + P.push(new BezierCurve(controlpoints,CenterIndex,MaterialIndex)); } -function pixel(controlpoint,width,MaterialIndex,Min,Max) +function pixel(controlpoint,width,MaterialIndex) { - P.push(new Pixel(controlpoint,width,MaterialIndex,Min,Max)); + P.push(new Pixel(controlpoint,width,MaterialIndex)); } -function triangles(CenterIndex,MaterialIndex,Min,Max) +function triangles(CenterIndex,MaterialIndex) { - P.push(new Triangles(CenterIndex,MaterialIndex,Min,Max)); + P.push(new Triangles(CenterIndex,MaterialIndex)); } // draw a sphere of radius r about center @@ -3066,7 +3414,7 @@ function sphere(center,r,CenterIndex,MaterialIndex,dir) for(let k=s; k <= 1; k += 2) { rz=k*r; for(let m=0; m < 2; ++m) - P.push(new BezierPatch(T(octant[m]),CenterIndex,MaterialIndex, + P.push(new BezierPatch(T(octant[m]),CenterIndex,MaterialIndex,null, Min,Max)); } } @@ -3114,7 +3462,8 @@ function disk(center,r,CenterIndex,MaterialIndex,dir) } let v=Tcorners(A.T.bind(A),[-r,-r,0],[r,r,0]); - P.push(new BezierPatch(T(unitdisk),CenterIndex,MaterialIndex,v[0],v[1])); + P.push(new BezierPatch(T(unitdisk),CenterIndex,MaterialIndex,null, + v[0],v[1])); } // draw a cylinder with circular base of radius r about center and height h @@ -3162,7 +3511,7 @@ function cylinder(center,r,h,CenterIndex,MaterialIndex,dir,core) rx=i*r; for(let j=-1; j <= 1; j += 2) { ry=j*r; - P.push(new BezierPatch(T(unitcylinder),CenterIndex,MaterialIndex, + P.push(new BezierPatch(T(unitcylinder),CenterIndex,MaterialIndex,null, Min,Max)); } } @@ -3286,7 +3635,7 @@ function rmf(z0,c0,c1,z1,t) } // draw a tube of width w using control points v -function tube(v,w,CenterIndex,MaterialIndex,Min,Max,core) +function tube(v,w,CenterIndex,MaterialIndex,core) { let Rmf=rmf(v[0],v[1],v[2],v[3],[0,1/3,2/3,1]); @@ -3320,7 +3669,7 @@ function tube(v,w,CenterIndex,MaterialIndex,Min,Max,core) T8*x+T9*y+w2]; } } - P.push(new BezierPatch(s,CenterIndex,MaterialIndex,Min,Max)); + P.push(new BezierPatch(s,CenterIndex,MaterialIndex)); } f(1,0,0,1); @@ -3329,7 +3678,7 @@ function tube(v,w,CenterIndex,MaterialIndex,Min,Max,core) f(0,1,-1,0); if(core) - P.push(new BezierCurve(v,CenterIndex,MaterialIndex,Min,Max)); + P.push(new BezierCurve(v,CenterIndex,MaterialIndex)); } async function getReq(req) @@ -3358,7 +3707,7 @@ function createTexture(image, textureNumber, fmt=gl.RGB16F) async function initIBL() { - let imagePath=imageURL+image+'/'; + let imagePath=W.imageURL+W.image+'/'; function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); @@ -3371,7 +3720,7 @@ async function initIBL() } promises=[ - getReq(imageURL+'refl.exr').then(obj => { + getReq(W.imageURL+'refl.exr').then(obj => { let img=new Module.EXRLoader(obj); IBLbdrfMap=createTexture(img,0); }), @@ -3415,8 +3764,8 @@ async function initIBL() function webGLStart() { - canvas=document.getElementById("Asymptote"); - embedded=window.top.document != document; + W.canvas=document.getElementById("Asymptote"); + W.embedded=window.top.document != document; initGL(); @@ -3425,22 +3774,22 @@ function webGLStart() gl.enable(gl.DEPTH_TEST); gl.enable(gl.SCISSOR_TEST); - canvas.onmousedown=handleMouseDown; + W.canvas.onmousedown=handleMouseDown; document.onmouseup=handleMouseUpOrTouchEnd; document.onmousemove=handleMouseMove; - canvas.onkeydown=handleKey; + W.canvas.onkeydown=handleKey; - if(!embedded) + if(!W.embedded) enableZoom(); - canvas.addEventListener("touchstart",handleTouchStart,false); - canvas.addEventListener("touchend",handleMouseUpOrTouchEnd,false); - canvas.addEventListener("touchcancel",handleMouseUpOrTouchEnd,false); - canvas.addEventListener("touchleave",handleMouseUpOrTouchEnd,false); - canvas.addEventListener("touchmove",handleTouchMove,false); + W.canvas.addEventListener("touchstart",handleTouchStart,false); + W.canvas.addEventListener("touchend",handleMouseUpOrTouchEnd,false); + W.canvas.addEventListener("touchcancel",handleMouseUpOrTouchEnd,false); + W.canvas.addEventListener("touchleave",handleMouseUpOrTouchEnd,false); + W.canvas.addEventListener("touchmove",handleTouchMove,false); document.addEventListener("keydown",handleKey,false); - canvasWidth0=canvasWidth; - canvasHeight0=canvasHeight; + W.canvasWith0=W.canvasWidth; + W.canvasHeight0=W.canvasHeight; mat4.identity(rotMat); @@ -3449,6 +3798,20 @@ function webGLStart() window.addEventListener("resize",resize,false); - if(ibl) + if(W.ibl) initIBL().then(SetIBL).then(redrawScene); } + + window['webGLStart']=webGLStart; + window['light']=light; + window['material']=material; + window['patch']=patch; + window['curve']=curve; + window['pixel']=pixel; + window['triangles']=triangles; + window['sphere']=sphere; + window['disk']=disk; + window['cylinder']=cylinder; + window['tube']=tube; + +})(); |