How to edit the converted model
-
Hi! If I want to adjust the imported dxf model by mouse or form in jscad. what do I do? It is found that the js code converted by @jscad/dxf-deserializer is not readable code. Does this mean that the imported model cannot be adjusted with the mouse?
@z3dev// Produced by JSCAD IO Library : DXF Deserializer (2.3.2) const { colors, geometries, maths, primitives, transforms } = require("@jscad/modeling"); const { colorize, hexToRgb } = colors; const main = () => { let layers = []; return layers.concat(layer0(),layer1(),layer2(),[]) }; function createPolygon(listofpoints, color) { let polygon = geometries.poly3.fromPoints(listofpoints); if (color) polygon.color = color; return polygon; } function layer0() { const jscad2_polygons = [ createPolygon( [ [-7.477781319009107, 0, 4.999988321182407], [-7.477781319009107, 0, 0], [-7.571599135852652, -0.0100263315710659, 0], ], null ), createPolygon( [ [-7.477781319009107, 0, 4.999988321182407], [-7.571599135852652, -0.0100263315710659, 0], [-7.571599135852652, -0.0100263315710659, 4.999988321182407], ], null ), createPolygon( [ [-7.571599135852652, -0.0100263315710659, 4.999988321182407], [-7.571599135852652, -0.0100263315710659, 0], [-7.845747687667226, -0.07906478610326254, 0], ], null ), ... ]; let jscad2 = geometries.geom3.create(jscad2_polygons); return [jscad2]; } function layer1() { return []; } function layer2() { return []; } module.exports = { main }; -
@jess-yan another good question!
there's an issue with the internal logic of the WEB UI that prevents the 'script' to be shown. it's not that easy to fix either.
you can use the CLI (command line) application to convert the DXF file to a script.
you can find instructions on how to use the CLI in the README file at...
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/cli
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login