Difference between revisions of "Template:Jscad"

From BITPlan Wiki
Jump to navigation Jump to search
Line 15: Line 15:
 
[[Category:Template]]
 
[[Category:Template]]
 
</noinclude><includeonly>
 
</noinclude><includeonly>
{{#tag:jscad|{{{code|}}}}}
+
{{#tag:html|<head>
<html><head>
 
 
   <script src="/extensions/OpenJsCad/lightgl.js"></script>
 
   <script src="/extensions/OpenJsCad/lightgl.js"></script>
 
   <script src="/extensions/OpenJsCad/csg.js"></script>
 
   <script src="/extensions/OpenJsCad/csg.js"></script>
Line 76: Line 75:
 
<body onload="onload()">
 
<body onload="onload()">
 
<input type="submit" value="Update" onclick="updateSolid(); return false;">
 
<input type="submit" value="Update" onclick="updateSolid(); return false;">
<html>
+
}}
 
</includeonly>
 
</includeonly>

Revision as of 09:14, 10 June 2019

Usage

Put your JSCAD code inside a source tag and add a call of this template

<source lang='javascript'></source>
{{jscad|code=function main() {
}
}}

Example

OpenJsCad demo: Parametric Lamp Shade