Reputation: 2086
I have some basic models that were originally drawn in SolidWorks, then saved as STL files. I am trying to put together some test questions for students that involve very basic shapes shown from different angles to see if they can guess the shape of the object in the missing angles like this.
Then after they guess, I would reveal the true shape of the object in 3D. Here is an example of the model that I am currently working on:
Working JSFiddle
https://jsfiddle.net/ajhalls/5gLeb5vk/
As you can see there are a bunch of "extra" lines in the wireframe from triangulation of surfaces that shouldn't be there, which isn't really an issue in the solid view, but I need to generate the individual wireframe type views you see above with hidden lines being dashed like the the bottom example.
I tried cleaning up the model in Blender using Dissolve Lines, in Sketchup I tried using the Clean3 plugin, but anytime I got it to take away the extra lines, it would distort the shape.
On another project I had been playing with Three.js, so thought maybe I could do that, and I saw some interesting posts on that such as: three.js wireframe only shape with hidden edges as dashed lines
He seems to be trying to do the same thing, but I don't see him using an STL, actually I am not sure what his "answer" means, as I am not sure what object he is trying to add, nor if it is coming from the same source, but with different filters applied, or if he is removing faces and leaving points in one, and then opposite in another file and then including them separately at the same position.
In this example: http://jsfiddle.net/car3v/4/ He has done some cool work, but is using an array of points rather than using an STL, I am not sure that it really applies, unless I can convert the STL to points, other than he has the right type of end result.
I am not sure what to try next. About the only thing I can think of is to export the views in Sketchup to a JPG, import it to Adobe Illustrator, trace it by hand and delete the original, but it seems there should be a better way of exporting the ortho views with hidden lines dashed, or cleaning up the STL to remove all the extra data points.
code to satisfy the requirement since I have a jsfiddle link
Upvotes: 2
Views: 971
Reputation: 1003
did you check with THREE.EdgesHelper.var wire = new THREE.EdgesHelper(mesh,0xff00ff);scene.add(wire);
// mesh defines your STL mesh check this bit of code after adding the STL mesh to scene
Upvotes: 0