Buona sera, sto cercando di creare un tool in js chem i permetta di scaricare in formato vettoriale il tracciato di ritaglio per una scatola. MI spiego meglio, utilizzando la libreria three.js io creo la visualizzazione della mia scatola in 3d, ora dovrei fare in modo di creare e far scaricare il tracciato fustella della scatola con le dimensioni che ho inserito. googlando un po ho trovato questo codice, ma non so se è quello che mi serve e non l'ho ben capito.
codice:
function addShape( object, shape, material_in, material_out, x, y, z, rx, ry, rz, s ) {
// flat shape
var geometry_in = new THREE.ShapeGeometry( shape );
var geometry_out = new THREE.ShapeGeometry( shape );
geometry_out.computeFaceNormals();
var mesh_in = new THREE.Mesh( geometry_in, material_in );
mesh_in.position.set( x, y, z );
mesh_in.rotation.set( rx, ry, rz );
mesh_in.scale.set( s, s, s );
var mesh_out = new THREE.Mesh( geometry_out, material_out );
mesh_out.position.set( x, y, z );
mesh_out.rotation.set( rx, ry, rz );
mesh_out.scale.set( s, s, s );
object.add( mesh_in );
object.add( mesh_out );
}
Grazie mille