<title>Box by extrude</title>
<script type="text/javascript" src="nt3d.js"></script>
<script type="text/javascript">
- function box_by_extrude(size_as_string) {
- var size = parseFloat(size_as_string);
+ function box_by_extrude(size) {
var origin = [0, 0, 0];
var x = [size, 0, 0];
var y = [0, size, 0];
<title>Box by faces</title>
<script type="text/javascript" src="nt3d.js"></script>
<script type="text/javascript">
- function box_by_faces(size_as_string) {
- var size = parseFloat(size_as_string);
+ function box_by_faces(size) {
var origin = [0, 0, 0 ];
var x = [size, 0, 0 ];
var y = [0, size, 0 ];
<title>Box by quadstrip</title>
<script type="text/javascript" src="nt3d.js"></script>
<script type="text/javascript">
- function box_by_quadstrip(size_as_string) {
- var size = parseFloat(size_as_string);
+ function box_by_quadstrip(size) {
var origin = [0, 0, 0 ];
var x = [size, 0, 0 ];
var y = [0, size, 0 ];
<title>Box by rotation</title>
<script type="text/javascript" src="nt3d.js"></script>
<script type="text/javascript">
- function box_by_rotation(size_as_string) {
- var size = parseFloat(size_as_string);
+ function box_by_rotation(size) {
var origin = [0, 0, 0 ];
var x = [size, 0, 0 ];
var y = [0, size, 0 ];
<title>Box by trianglefan</title>
<script type="text/javascript" src="nt3d.js"></script>
<script type="text/javascript">
- function box_by_trianglefan(size_as_string) {
- var size = parseFloat(size_as_string);
+ function box_by_trianglefan(size) {
var origin = [0, 0, 0 ];
var x = [size, 0, 0 ];
var y = [0, size, 0 ];
// Get params from form
var params = [];
for (var i = 0; i < this.user_params.length; i++) {
- params[i] = this.form.elements["param"+i].value;
+ var as_string = this.form.elements["param"+i].value;
+ var as_num = +as_string;
+ params[i] = isNaN(as_num) ? as_string : as_num;
}
// Run user_function