Jump to content

SylvainLS

Eurobricks Counts
  • Posts

    1,356
  • Joined

  • Last visited

Everything posted by SylvainLS

  1. Hey people, I see my last post generated a few views, so I’m guessing I’m not talking in my head I have a puzzle for someone who knows their stuff about voxelization. I implemented (or copied and translated to be more precise) 3 voxelization methods and “devised” my own: method 0 is Schwarz-Seidel (implementation Rama Hoetzlein), method 1 is Voorhies’ cube-triangle intersection (Graphics Gems III), method 2 is Tomas Akenine-Möller’s AABB-triangle overlap (his code), the first three methods go through the whole voxel space for each triangle to search for the voxels that intersect with said triangle, in O(number of triangles x voxel space size), method 3 is mine: I use Bresenham to draw the edges and fill them, I simply draw the filled triangle in the integer voxel space, in O(sum of triangles’ surfaces). The results on the 3947 crater plate (hey it’s LEGO! still on topic!), 5656 triangles (no studs!), with a voxel space of 100x100x16 (yes, it’s small, you need to zoom): As for results and the main puzzle: 0 shows “flares” (and a nasty one at that), I guess it’s floating point calculations errors with small vertical triangles (?), but I’m really surprised the implementation doesn’t care, 1 shows (you need to look closely) large “empty” triangles (their content is black, it should be gray-1), I guess/hope it’s a rounding error but it’s disappointing for flat triangles, 2 is perfect (AFAICT), 3 has some little troubles (corner cases, pun intended), and doesn’t find the same results (rounding issue? too simple). As for running on my PC (run with 4 threads, first time is real time, second time is user time (aka time it would take with one thread)): 0 takes 19s/76s, 1 takes 10s/39s, (better, as expected), 2 takes 4s/16s, (even better, as expected), and 3 takes 0.04s !! And that’s my second puzzle: I haven’t found anyone using a similar method out there, why? (Why 4 methods? As usal: I started with mine, thought someone necessarily did better before, found Hoetzlein’s code and method, found that his own method is flawed, used his code for Schwarz-Seidel’s, found the flares, found Voorhies’, had a problem because of a stupid copy-paste of mine but thought it was the code that had the problem, found Akenine-Möller’s, still had the bug, found the bug was mine, ran all three, thought, hey, why not finish mine to see if could work?) So if someone is interested in discussing this or could point me to someone who’d be….
  2. Little updates on both ldraw_cliff and ldraw_landscape: for both, it’s mainly about how parameters and their default values are handled (easier to edit), for ldraw_landscape, I added explanations and fields for the size of the uploaded image (which I can’t access from the html) to avoid loosing information when scaling. I made heightfields for the relief baseplates but I’m not very happy with the resulting landscapes: the baseplates become quickly unrecognisable with randomness , so I fear it’d only actually be usefull to make scaled brick (or rather plates) versions of the baseplates (using a slope of 0).
  3. But then, people would need to use those tools beforehand, so making a tool that combines flattening and making a heighfield reduces the number of tools. I started something but I forgot there were giant quads and triangles on baseplates, I need to “fill” them Sort of. Using bricks for high slopes would be great indeed but it’s a bit more complicated than replacing 1x1 plates with bigger plates, and the techniques are quite different and incompatible: ldraw_cliff builds the cliff by randomly piling bricks, ldraw_landscape creates or uses (or both) a heighfield and then uses plates to represent it. A lead I’m thinking about is to 3D-ize my plate-replacement algorithm to include bricks (and maybe slopes).
  4. Your file is indeed corrupted. I tried looking into it but there’s only 30 salvable bricks :(
  5. Thanks. I usually prefer the look of the old “fractal mountains” (isocele triangle, take the middle points, add random value, apply on the 4 smaller triangles, and again…) but it doen’t render well with squares, and, until recently, I found diamond-square to have too harsh artefacts (visible lines). But I recently found a simple implementation for the fractal line: instead of just adding a random value to the middle point, you can control the slope. And that’s what I applied here to diamond-square: instead of taking the average and adding a random value (which is one thing that creates artefacts because diagonals are longer than sides), I simply control the slope (find how high/low the point can be to respect the slope, set it randomly between those values). Thanks. I thought about using .dat files but didn’t do anything yet because they are recursive. Otherwise the principle is simple: take all the quads and triangles in the mesh, find the min and max X and Y and Z to scale them on your image, and put all the points in a bitmap on width*(X-Xmin)/(Xmax-Xmin), height*(Y-Ymin)/(Ymax-Ymin) and in a gray 255*(Z-Zmin)/(Zmax-Zmin). I don’t think I will do that in Javascript though, it’s impossible to read the recursive .dat files and stay simple/portable.
  6. Okay, so here it is. It’s a simple diamong-square/“plasma” algorithm. You can feed it a heightfield image and it will “alter” the results. Actually, it’s a multiplication: the image is grayscaled and we multiply each point of the randomized landscape with the luminance (black = 0, white = 1) of the matching point on the image (scaled to size). If you set the “height offset” (or max slope) to 0, the landscape is not random at all. So it’ll be totally flat if there’s no heightfield, and it’ll exactly be the heightfield if there’s one. Here’s the heightfield I used: Here’s the landscape with an offset of 0: And with an offset of 0.4: There’s no need to use a big image. Try to use one that more or less matches the desired dimensions. Force reload the page to clear the heightfield. (Note: it seems the image doesn’t always load correctly. Try again if it doesn’t appear below the button.) Download is here! EDIT: and of course, there was an “oopsy typo” in the code I uploaded
  7. It depends on the algorithm but it would be quite possible to force some features or altitudes. *sigh* And now you got me thinking and I will have to try something….
  8. If you get an outdated parts library with missing parts, it’s because you’ve installed 4.3.12. 4.3.12 isn’t a real 4.3.12, it’s 4.3.11 with an outdated parts library tweaked to install on Windows 10. Get a real 4.3.11 and use the tricks described in the thread below to install it on Windows 10:
  9. A little update on my cliff generator. Impelled by a discussion with supertruper1988, I changed the way the grass (or little bumps) on top of the cliff works. I simplified the algorithm and it now has fewer artefacts. When the top is flat (no height variation), it uses all sizes of plates (up to 16x16). That greatly reduces the number of parts. You can set the max height. This allows you to generate a slightly bumpy landscape (that was supertruper1988’s first goal): set the width (e.g. 100), set the height to 0, uncheck all the checkboxes, set the back line to the depth you want (e.g. 100), change the grass variation if you wish (e.g. 10), generate and save. Download is here.
  10. (So, a 57539 between a yellow 87617 and a red 87087.) For the part to be (usefully) flexable, you need to attach one end, and only one, and then click the other end and then move the mouse and it will (try to) follow. If you point a hole or a clip, it will try to connect into it. It follows slowly and you need to wait for it to settle down. You can’t flex a part with both ends connected. Well, you can if you click in the middle: it will slightly flex if it has room, say, it’s already flexed but not in the position you want. It won’t flex if it’s taut.
  11. Several solutions: 1. You can copy/paste the parts at will. 2. Try to transfer/copy the parts to another custom palette. 3. Palettes are plain text file, you can edit them. They are in a “Local Settings/Application Data/Stud.io/Buckets/Folders” directory on Windows. Just remove all the lines that start with “4 ” to remove quantities (“0 ” = dat file, “1 ” = name, “2 ” = colour code).
  12. Doing repetitive and tedious stuff is for machines, not humans Especially when all the necessary information should already be there.
  13. Note: Unless it’s a typo, you should really upgrade to 4.3.11. BUT NOT the 4.3.12 for Windows on the official website!
  14. Update 2020-04-04 Added: 11094 / 11094.dat Wheel 30 / 64 with 7 Pin Holes and 6 Small Holes 27256 / 27256.dat Minifig Lightning Bolt with Rim 29592 / 32765.dat Minifig Sports Barbells 90634 / 90634.dat Technic Connector 3 x 1 with Two Pins and Three Ball Joints on Axle 5L 93571 / 93571.dat Technic Ball Socket Round (name should be Constraction Connector 3 x 2 with Single Straight Ball Socket and Open Axle Holes) Rematched (more modern variant): 6014 / 6014b.dat Wheel Rim 11.2 x 10.4 with Notched Hole 3660 / 3660b.dat Slope Brick 45 2 x 2 Inverted with Inner Stopper Ring Corrected: 20455 / 20455.dat Windscreen Hemisphere 9 x 4 x 7 with 4 Hollow Studs on Top Importable: 3660.dat / 3660 ~Moved to to 3660a 3660a.dat / 3660 Slope Brick 45 2 x 2 Inverted without Inner Stopper Ring 28290.dat / 56890 =Tyre 12/ 61 x 11 Balloon 6014a.dat / 6014 Wheel Rim 11.2 x 10.4 with Round Hole 6014b.dat / 6014 Wheel Rim 11.2 x 10.4 with Notched Hole md5sum: 0a4e842a0e1a0faf8ee9111f82a0ff33
  15. It is just you: https://www.isitdownrightnow.com/bricklink.com.html
  16. Yes, you can directly render an spin animation, using the Animation tab in Render and choosing the right options (otherwise, it “builds” the model). To make a “visit” animation of your model, you need to render each frame one by one (and make a video of the frames). The render has a queue though, so you can place your camera, queue the render, move the camera, queue the render, etc., and then let the renders go (and hope all goes well and you didn’t miss a step). Edit: Ah, I see supertruper1988 answered too. Just so you know, a good NVidia GPU can speed up the render by 3x or 4x (or more if your CPU isn’t top notch), but it’s a couple hundred dollars investment.
  17. Is this because they use BL colours IDs and don’t translate LDraw ones correctly/consistently/everywhere?
  18. I don’t know anything about Macs so I can’t help on that part but for the LXF: LXF is actually a ZIP archive of two files, IMAGE100.LXFML (the model) and IMAGE100.PNG (a thumbnail), so what’s happening to you seems to be that your browser automatically unzips the LXF. So you should look into your browser’s options to stop that. (Look at file format (mime type) / application associations.) Or, you can simply rezip the LXF: get a dummy image in PNG, be sure both files are named IMAGE100.PNG and IMAGE100.LXFML (in caps), zip them together in whatever.zip and rename the zip in whatever.lxf.
  19. For the actuators: just “breaking” them in their components/subparts should allow any position in Studio. For the angles: you need a pencil, a sheet of paper, a rule and a compass, or a geometry software.
  20. No problem. At first, I had the same thought you did… but then I’ve a habit of reading too fast, so I checked the picture
  21. @RoddyMac Look better at the picture: CorvusA clicked on the colour palette of the paint tool but it only shows a red square instead of the 78 normaly available colours in Extended. By the way, @CorvusA, what do you get with the other colour palette (the one for the parts palette)?
×
×
  • Create New...