-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples for possible inclusion in isosurface.scad #1559
Comments
Nice! Shrinking the bounding box just a little bit, to Enclose your code between four backticks ```` instead of three single quote marks, to make it look like code. I have included this in the examples. I moved the wing back 5 units; as a pilot and former avid model airplane builer, I felt that the wing needed to move back for the center of gravity to look more correct; it looked tail-heavy originally. |
Ha... I'm also a pilot (SEL and LTA with about 25 solo hours in sailplanes but no sailplane rating). I kept the wing forward to keep the aft fuselage from getting too fat. That version was my first rough cut. If it can get the time I'll maybe add a cockpit canopy and tip-tanks. Not sure if I can turn it into an airliner with underwing engines. ...any idea how to do a NACA airfoil in metaballs? :) |
Cool. My ratings are single-engine land and glider aero-tow-only, and most "recently" I got an ultralight certification (before the recreational pilot rating existed). All this happened in Texas in the 1970s and 1980s when costs were reasonalble. I haven't flown in years, however. My last flight was to take my fiancee (now my wife) up for a spin in Virginia where I lived at the time. I live in California now, and it's too expensive to fly around here. I was thinking about an airfoil too. NACA is a rather precise formula, so I don't think that's possible with metaballs, but you may get something close by using negative metaballs to subtract the lower camber. |
Thanks Richard. You did a later one with a ball orbiting around all over the place. That's the one I'd like to use. Although... this one above is mesmerising to watch. Also, it would be better with axes turned off. |
Thanks Richard. Those files are huge! Nearly 1200x1000, way bigger than needed for a web page and consumes processing power moving 13 megabytes around repeatedly. Would it be possible to make it half the size, like normal 4:3 format 600x450? That's a reasonable size for a web image. It looks like it's already 8-bit and not 16-bit graphics, which is good. I tried converting these but ImageMagick doesn't seem to understand animated PNG files, or I just don't know how to use it (it's more vast in its options than BOSL2). Alternately, post the code and I can make them. I have made OpenSCAD animations for things I upload to Printables and Thingiverse. |
I'll poke around and see if I can find an APNG generation tool that lets me resize them. EZGIF.com doesn't appear to. The other options would be to decrease the frame rate. |
The problem is that a 13 megabyte graphic animation is a pretty big payload for this repo which is 20 MB without that graphic. Also, the whole 13 MB must by downloaded by every browser, which may cause unnecessary expense with metered connection and just adds unnecessary bulk and server load to the traffic. When I do an animation, I have OpenSCAD save every frame to png, and then I use the ImageMagick 'convert' or 'magick' commandline to merge them all into an animation. It can do other things like crop, resize, resample, etc. while it's making the animation. You can get the file size reasonably small with it. I had another thought while taking a nap today. I imagined a rounded cube, a torus, and a ball with intersecting orbits, and the cube and the torus were rotating around multiple axes as they moved. The objects orbits also wouldn't be much bigger than the size of each object, so they'd be interacting with one another most of the time. |
OH! Hadn't thought of usiing ImageMagick. Good idea! Probably quicker too. |
That's much more reasonable size, under 4 MB. It's still PNG, though, and needs cropping. It might fit in 600x450. If it was GIF I could do it but I can't do anything with animated PNG without losing the animation. I like the image that looks like balls moving under a blanket. There's something I find faintly creepy about it. When I set up an animation, I adjust the preview window to the size I want. You can see the size in the bottom bar of the OpenSCAD window. This is really hard to do on a high-resolution display if you're going for an exact size. I have a second monitor with low resolution so I usually put OpenSCAD there to get better control over the window size. Then I set the preview to the zoom level and position I want, and start the animation. |
Thanks. Added to #1564 |
Really nice work. For the duck, I wonder if you could use a couple of negative balls with a close cutoff to make indentations where the eyes would go. |
@RAMilewski you have an extra comma before the closing parenthesis in lines 46 and 48. |
Giraffe has trailing commas in the horns section that fail in stable openscad. Model runs as is so there aren't any extra parentheses. |
@RAMilewski - would you update the giraffe code above with the latest? Also, how long does this take for you to render it? The code above took 5 minutes on my computer. |
Be sure to check the metaballs argument order on both of those. I think you were discussing changes to the argument order. |
The tail of the giraffe looks fine with any voxel size if you remove the influence argument. The new mb_cyl, now that it has more influence on its surroundings, really messed up the head and neck. Here's my attempt at repairing it. I had to shrink the dimension arguments for the head, neck, and body. At voxel_size=0.85 it takes 1:08 to preview for me.
|
I like how the bunny looks like it's smiling. Execution time can be much faster if each component has its own bounding box. Total time went from 1 minute to 10 seconds, for me. For the duck, it might be better to make some soft indentations in the head, and then embed regular non-metaball spheres in those indentation to make eyes. |
I got the bunny down to 25 seconds (which would probably be 15 seconds on your machine) with voxel sizes smaller than 1. What helped the most was having separate bounding boxes for each component, and I shaved off several more seconds by saving the ear, hind leg, and front leg into VNF structures, and then uxing vnf_polyhedron() to render copies of them. In this way those metaballs don't need to be computed twice. |
I think your giraffe fix is fine. Go with that. I want to fiddle with the horns and ears a bit, but we can update that in some future post-release PR. I feel really dumb about the bounding_boxes on the bunny! I even went through the console and added up all the voxel bounding box spaces to set the overall number! Putting them into VNFs is the obvious way to handle reusing and distributing parts if they're not in the same call to metaballs(). |
Yes, I did make that point in the example in the docs. It's in the latest version of the PR #1566 |
Note that these use a local copy of isosurface.scad so line 2 must be changed before inclusion.
The text was updated successfully, but these errors were encountered: