Meshy - A Browser-based Tool For Doing Measurements And Post-processing

Discussion in 'Software and Applications' started by 0x00019913, Mar 2, 2017.

  1. 0x00019913
    0x00019913 Active Member
    Hey, all.

    I made a WebGL-based tool that does measurements and simple transformations on STL and OBJ files. Dunno if anyone here needs it, but I've personally needed this specific functionality before and found existing packages, like Netfabb, somewhere between unhelpful and inconvenient. Thought I'd leave it here. I'll bump the thread when I've put in more functionality.

    TLDR: Here it is. No download, all in the browser.

    And here's a user guide.

    Disclaimer: still very much a work in progress. Likely has bugs. If anyone finds an issue, I'd very much appreciate a post about it.

    A browser that can supports WebGL. I only guarantee that this runs in Chrome and Firefox, though it also appears to run in Opera and (thanks to shawn_halayka for checking) Safari. Please don't use IE. I've run it on Windows 8.1 and Ubuntu 15.04/16.04 with an Nvidia GTX 870M. For the meshes, there's a rough upper limit of 50-80MB, though your setup might be able to handle more (or less).

    Formats (import and export):
    • STL (binary and ASCII)
    • OBJ

    • segment length
    • angle between two segments
    • circle params (radius, diameter, circumference, arc length)
    • cross-sectional area plus dimensions of the cross-section in an axis-aligned plane

    • center of mass
    • volume
    • surface area

    Transformations (all relative to the origin):
    • translate
    • rotate
    • scale (by factor, to size, to a specific measurement)
    • floor
    • center

    Mesh thickness:

    Meshy will color every face red if the mesh's approximate local thickness at the center of a given face is below the specified threshold; the deeper the red, the farther the thickness is below the threshold.


    Meshy will close holes bordered by boundary edges (such that each edge borders exactly one face).

    Sample workflow - measure something:
    1. Upload a model.
    2. Go to Measure and pick one.
    3. Click on the model to place a marker. This will do different things depending on the measurement type. The length measurement will take two markers, angle and circle will take three, cross-section only needs one. The measurement will appear in the info box to the left when you've placed enough markers.

    Sample workflow - making a set of rings of different sizes:
    1. Make a ring and upload the model.
    2. Do Transform -> Scale -> Scale To Ring Size.
    3. Click mCircle and put three markers on the internal surface of the ring to mark its inner diameter.
    4. Select a size, click scaleToRingSize.
    5. Go to Export and save the model. Rinse and repeat.
    ^ Can alternately be done by making a circle measurement from Measure -> mCircle, then doing Transform -> Scale -> Scale To Measurement and entering a specific radius/diameter/whatever.

    Sample workflow - see how your jewelry hangs:
    1. Make, say, a pendant. Upload it.
    2. Do Mesh Display -> toggleCOM. This calculates the center of mass and puts an indicator on it so that it's clearly visible.

    What's next:
    I plan to put in some form of remeshing algorithm in the coming days. Maybe mesh decimation, but that's up in the air - ideally, meshes uploaded to this tool would be fairly light already (on the order of 1-2M polys is the rough limit). Maybe options for changing the material beyond just the color. Suggestions welcome.
    Last edited: May 23, 2017
    shawn_halayka likes this.
  2. UniverseBecoming
    UniverseBecoming Well-Known Member
    I like what you have so far. What would be really cool related to scaling rings to particular sizes would be an automated process where one would start with the lowest size and then scale up to US size 16 in quarter sizes and then be able to download all of the sizes as a zip file or automatically upload all of the sizes to Shapeways.

    A prominent aspect that comes into play when doing this is (I have a Winautomation macro that I created that does this for me and that's how I know) the amount of data that is generated. From size 3 to 16 in quarters is 64 sizes, and if each is one million triangles, that ends up being about 48 megabytes X 64, so around three gigabytes of data.
  3. 0x00019913
    0x00019913 Active Member
    Indeed, I was contemplating something like this. The browser memory limitations pretty much make the zip file thing impossible, though it would be easy to automate exporting a set of rings. I'm picturing something like: the user imports the model, sets the circle measurement, then sets a starting diameter, an ending diameter, and a count.
  4. UniverseBecoming
    UniverseBecoming Well-Known Member
    @AlanHudson you might like to see about implementing something like this automated scaling of rings within Shapeways.

    0x00019913 I know people would use this outside of Shapeways as well. You don't even need to make it so it makes a whole set of sizes downloadable. All that is really needed is to pick the size someone might want from a list of sizes. I do a lot of rings sales both on Shapeways and other marketplaces. Usually, what happens is (before I made the automated size maker that I now use) I'd get an order in a size I don't have made and I'd fire up my 3D modeling software, load in the base size and do the scaling and export as an STL. That would involve opening a CSV file I have of all of the sizes and entering the corresponding dimension number in the software to do the scaling. I also, load the resulting STL in another piece of software to double check that the size I adjusted to is correct. This is not easy to set up in 3D modeling software by the way. So, I could see your service being used instead for newer 3D modeling software users where they would just upload, pick the size the ring is currently from a list and the size they want to convert to from a list and then download the result.
  5. 0x00019913
    0x00019913 Active Member
    Kk, scaling to ring size is a go (added a "Special" tab). :D Will test for more bugs and think about automation tomorrow. And maybe add some organized documentation to the tool itself.
  6. UniverseBecoming
    UniverseBecoming Well-Known Member
    Hey! That's pretty cool! I uploaded a size 3 and converted it to a size 15 without issue and also very quickly. I used Google Chrome. I like how one doesn't even need to know the starting size as once the ID is determined it figures out what scaling factor is needed to go to any other size.

    How in the world do you do software like this? What programming language are you using? I have always been fascinated by computer programming but was never able to learn any of the languages.
  7. mkroeker
    mkroeker Well-Known Member
    Seems to be built on top of the very versatile (and free) three.js javascript library - see for code and examples
  8. shawn_halayka
    shawn_halayka Well-Known Member
    Hey man, your 3D app runs great on Apple Safari for Mac OS X.
  9. UniverseBecoming
    UniverseBecoming Well-Known Member
  10. 0x00019913
    0x00019913 Active Member
    Sweet! I try to only use JS stuff that's universally supported (no guarantees for old IE versions, of course), but I never know if I missed something.

    @UniverseBecoming - Yeah, Three.js is great. It's built on top of WebGL (which is a fairly recent API that lets you put 2D and 3D graphics in an HTML element), but it's much, much easier to use than plain WebGL. To answer your original question, I'd cite the fact that I majored in CS, but really, I just learned this all on my own time. :p This tool is all Javascript, you can learn it by looking up tutorials. It's a good place to start, too, if you wanna learn an easy, very permissive language.

    Or look up some Python tutorials, that's even easier.
  11. 0x00019913
    0x00019913 Active Member
    Hey, all. It's been a while. I've been busy with other stuff. :p But in the meantime I've put in the following things:

    1. A vertex-based hole-closing algorithm (as opposed to voxel-based, AKA volumetric). This may be temperamental and not battle-tested, but it works for all of my test cases. I would very much appreciate it if anyone could let me know if it breaks in any way.
    2. A user guide.
    3. Some STL- and OBJ-loading optimizations. The code is now more maintainable and faster.
    4. Lots of preliminary code for voxel mechanisms. I want to implement a thickness viewer and some form of octree-based repair algorithm (like this).
    Last edited: Apr 18, 2017
  12. 0x00019913
    0x00019913 Active Member
    More stuff!

    1. Mesh thickness viewer. It's approximate and I'm working on a faster + more accurate one, so that might happen sometime soon.
    2. Can now also import ASCII STL files (could only do OBJ and binary STL before).
    3. Updated the user guide.

    I looked at it on the only Mac I have access to and it looks... really white. Something is bad with the tonemapping. But I looked at it on a different Mac I can no longer access and it was fine there. Why, Apple, why?