OpenJSCAD.org
OpenJSCAD.org copied to clipboard
[Feature Request] Wire frame mode
I want to have Wire frame view in OpenJSCAD.
For example, when I have cube with hole. With current view, it's difficult to see how deep the hole.
Here is screenshots from FreeCAD.
Normal View
Wire frame View
@ikeji the sample in your screenshot is actually not wireframe but outline. Wireframe would show all vertices.
This would be a nice feature to have, but may be a long time until available.
I have two alternatives that could help you with the visualisation.
subtractX transparency
paste this function into your script
function subtractX(first, ...rest){
return [ ...rest, colors.colorize([1,0,0,0.5],first) ]
}
for example if you take this test script
const jscad = require('@jscad/modeling')
const { connectors, geometry, geometries, maths, primitives, text, utils, booleans, expansions, extrusions, hulls, measurements, transforms, colors } = jscad
const { cylinder, cuboid, cube, sphere, circle, star,cylinderElliptic, polyhedron, roundedRectangle, rectangle } = primitives
const { translate, scale } = transforms
const { union, subtract, intersect } = booleans
function subtractX(first,...rest){
return [ ...rest, colors.colorize([1,0,0,0.5],first) ]
}
function main(){
return subtract(
cube({size:20}),
translate([0,0,6], cylinder({height:8,radius:5}))
)
}
module.exports = {main}
then all you need to preview the boolean operaton, change one letter :)
return subtractX(
also, just showing geometries of a boolean operation is faster than the boolean operation itself
cut with a large cube to see the inside
const jscad = require('@jscad/modeling')
const { connectors, geometry, geometries, maths, primitives, text, utils, booleans, expansions, extrusions, hulls, measurements, transforms, colors } = jscad
const { cylinder, cuboid, cube, sphere, circle, star,cylinderElliptic, polyhedron, roundedRectangle, rectangle } = primitives
const { translate, scale } = transforms
const { union, subtract, intersect } = booleans
function main(){
return subtract(
cube({size:20}),
translate([0,0,6], cylinder({height:8,radius:5})),
translate([0,-10,0], cube({size:20})), // cut with cube to see inside
)
}
module.exports = {main}
I do think a vertex rendering mode could be helpfull too.
You could just extract the vertices becaus jscad supports rendering them
I do think a vertex rendering mode could be helpfull too.
You could just extract the vertices becaus jscad supports rendering them
I think that you mean… the viewer supports lines between points. But sadly, only 2D lines. It definitely could be possible.
I do think a vertex rendering mode could be helpfull too.
You could just extract the vertices becaus jscad supports rendering them
We are not against it :) ... we will get to it eventually :) so I posted workarounds ... also contributions are welcome :)