Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Distributing objects across a surface

  1. #1
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    531

    Distributing objects across a surface

    Hi all,

    This has come up for me a few times, but I've never found a satisfactory answer or method.

    I need to randomly distribute objects (in this case, simple hemispheres) across a roughly hemispherical surface. They need to be close to each other, but with a small gap between, and not overlap. I will eventually need it as actual geometry.

    I have tried instances, but the 'relax' option doesn't prevent intersecting instances. Which is a shame because this should be the perfect tool for the job.

    I have tried particles, hoping that the self-interaction settings could be used to keep the attached instances away from each other, but I am not seeing any effect. Does anyone know under which circumstances the 'self interaction' on particles keeps them apart?

    I have tried creating a triangular mesh, adding a bit of jitter, heatshrinking to to the original geometry, and applying instances or using Place Mesh to populate this geometry, but I have yet to find the sweet spot between it looking too regular and having instances overlap. I'm looking at needing 1000+ objects on the surface, so adding them manually with place mesh isn't an option.


    Or does anyone know of any other native methods or free plugins which could achieve what I'm after.

    Cheers,

    Derek

    *edit - I'm using LW2019
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Particles-interaction.JPG 
Views:	82 
Size:	106.4 KB 
ID:	148310  
    Last edited by kyuzo; 07-09-2020 at 09:19 AM. Reason: Extra info...

  2. #2
    Founding member raymondtrace's Avatar
    Join Date
    May 2003
    Location
    Ohio
    Posts
    1,333
    Will these attached objects be static or animated? If animated, in what manner?
    LW4, 7.5D, 2015, 2018, 2019, 2020 running portably on a USB drive.
    Active LW Development in 2020: DB&W | Deep FX | DPont | LWCAD | TrueArt | ...

  3. #3
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    531
    No, just static. I eventually need to create a single mesh for exporting as an .stl, for machining on CNC.

    I have also tried using flocking to get the blobs to stick to the surface with random distances between them, but when they contact the 'avoid' mesh they just bounce off like angry bees. I have been able to use flocking to have objects group together on a mostly flat mesh, such as terrain, but cannot see how to make the same thing work on a hemisphere.

  4. #4
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    17,799
    For self interaction, collision..you need to hit calculate for the particles dynamics, otherwise the collision will not take place... and the collision boundary is the particle size you set in particle emitter, not the boundary of linked objects since it is the particles that drives the motion or placement in the first place as well as collision.

    This means you will not get an exact geoshape collision, only spherical boundary collision with particle fx boundaries.
    You could try bullet and negative forces..that could allow for more accurate mesh boundary collisions, this means no particles but messing with forces and bullet bodies only.

  5. #5
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    531
    Ah, thanks Prometheus, that helps. I haven't gotten perfect results yet, but things have certainly improved.

    I couldn't see the 'calculate' button as I was accessing the particle settings through the 'Appearance' tab, not the 'FX' tab, so it wasn't visible. Otherwise I might have thought to click on it...

    Will look into a bullet example tomorrow.

    Cheers,

    Derek

  6. #6
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    531
    Actually prometheus, I haven't used bullet much at all, can you give a couple of more pointers how I could set something up using 'negative forces'?

    I have tried setting up a static body, and a 'parts' mesh with loads of small spheres, but they're just bouncing off the larger shape even if I have friction right up to 100%. I'm not sure where 'negative forces' come into it. Gravity seems to be in a specific vector. Not sure how I can set up an object as an attractor?
    I sense I'm missing something fundamental. If you can point me in the direction of a tutorial or provide a few more keywords for me to google I'd much appreciate it.

    I'm switching off for the night. Will mull things over and have another look tomorrow.

    Cheers,

    Derek

  7. #7
    Quote Originally Posted by kyuzo View Post
    Actually prometheus, I haven't used bullet much at all, can you give a couple of more pointers how I could set something up using 'negative forces'?

    I have tried setting up a static body, and a 'parts' mesh with loads of small spheres, but they're just bouncing off the larger shape even if I have friction right up to 100%. I'm not sure where 'negative forces' come into it. Gravity seems to be in a specific vector. Not sure how I can set up an object as an attractor?
    I sense I'm missing something fundamental. If you can point me in the direction of a tutorial or provide a few more keywords for me to google I'd much appreciate it.

    I'm switching off for the night. Will mull things over and have another look tomorrow.

    Cheers,

    Derek
    Try adding a null object to your scene and turning it into an Explosion (FXtools > Forces > Explosion). Make sure the null is positioned in the center of your main object.
    Then in the Bullet Properties panel (FXtools > Bullet > Item Properties), set the Strength to -1.
    Also, on the World Tab in the Bullet panel, set Gravity to be 0,0,0.

    If you've already set up your parts object and your main object (the one you want all the parts to stick to), then Bullet should just stick those parts to the surface of the main object. You may have to adjust the Friction settings for your parts and the main object to get less sliding around on the surface.

  8. #8
    RETROGRADER prometheus's Avatar
    Join Date
    Aug 2003
    Location
    sweden stockholm
    Posts
    17,799
    Quote Originally Posted by kyuzo View Post
    Actually prometheus, I haven't used bullet much at all, can you give a couple of more pointers how I could set something up using 'negative forces'?

    I have tried setting up a static body, and a 'parts' mesh with loads of small spheres, but they're just bouncing off the larger shape even if I have friction right up to 100%. I'm not sure where 'negative forces' come into it. Gravity seems to be in a specific vector. Not sure how I can set up an object as an attractor?
    I sense I'm missing something fundamental. If you can point me in the direction of a tutorial or provide a few more keywords for me to google I'd much appreciate it.

    I'm switching off for the night. Will mull things over and have another look tomorrow.

    Cheers,

    Derek
    Follow the description from Axis3d

  9. #9
    ex-LightWave documentation BeeVee's Avatar
    Join Date
    Feb 2003
    Location
    Pessac
    Posts
    5,276
    If you just want them to be attached to your surface you could copy the base mesh onto another layer. Unweld the polys (I used Ctrl-Space, then typed 'unw' and hit return); then use Size in Local mode to shrink all the polys that make up the mesh as small as possible, then use merge points (M) to make a web of single points that are in the middle of all your original polygons. You'll probably end up with 2- or more-point polys but I just deleted those. I had enough single-point polys for the effect.

    B
    Ben Vost
    LightWave 3D Docs wiki
    AMD Threadripper 1950X, Windows 10 Pro 64-bit, 32GB RAM, nVidia GeForce GTX 1050Ti (4GB and 768 CUDA cores) and GTX 1080 (8GB and 2560 CUDA cores) driver version 456.71, 2x4K 23.5" monitors
    Dell Server, Windows 10 Pro, Intel Xeon E3-1220 @3.10 GHz, 8 GB RAM, Quadro K620
    Laptop with Intel i7, nVidia Quadro 2000Mw/ 2GB (377.83 and 192 CUDA cores), Windows 10 Professional 64-bit, 8GB RAM
    Mac Mini 2.26 GHz Core 2 Duo, 4 GB RAM, 10.10.3

  10. #10
    da what? daforum's Avatar
    Join Date
    May 2006
    Location
    Bristol, England
    Posts
    1,693
    Also have a look at some of the 'Clone' plugins/scripts on the the LW Plugin Site, as some clone to poly normals etc.
    https://www.lightwave3d.com/assets/plugins/
    Montage Reel, Portfolio, PIN_01, Prime......«« go on, click on a link!

  11. #11
    Registered User
    Join Date
    Jan 2005
    Location
    Colorado Springs
    Posts
    1,876
    For non-intersecting instances, I've used the Merge Points with a Fixed distance to eliminate points that are "too close" for the instanced geometry.

    For example, the image posted in #1 looks something like a Capsule. I'd create the Capsule in Modeler with enough Segments and Sides to provide a lot of points. Then select all the points, copy them to another layer and use Jitter to get some random offset. Finally, use Merge Points with the Fixed Size set to the diameter of the hemisphere to eliminate points that are too close together and would cause intersecting instances. Then, use the resulting point cloud to instance the hemispheres.

    Click image for larger version. 

Name:	01_FixedSize_MergePoints.jpg 
Views:	39 
Size:	729.2 KB 
ID:	148311 Click image for larger version. 

Name:	02_AfterMergePoints.jpg 
Views:	41 
Size:	651.4 KB 
ID:	148312

    Maybe.

    mTp

  12. #12
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,469
    SprayBgPoints from TrueArt's Modeling Pack will do the trick.

    YouTube video showing this tool at action.
    Title "TrueArt LightWave 3D Tutorial How To Spray Instances Avoiding Overlapping Full HD video"

  13. #13
    Member
    Join Date
    May 2006
    Location
    France
    Posts
    4,217
    Fast relaxation,

    Click image for larger version. 

Name:	instances_vs_instances.jpg 
Views:	52 
Size:	213.9 KB 
ID:	148314

    Denis.

  14. #14
    Registered User
    Join Date
    Feb 2003
    Location
    Cumbria UK
    Posts
    531
    Thanks for all the suggestions, much appreciated.


    Prometheus & Axis3D - thanks for the explanation, I'll give that a go and see how I get on.

    dpont - Your instancer plugin looks like it can produce the exact density or pattern of instances that I need very well. The only thing I couldn't see was whether it is just a rendering effect, or if I can somehow export actual geometry from it..?

    MonroePoteet - I did experiment with a similar technique to your suggestion. Where I ran into difficulty was that I will probably need the instances aligned facing out from a poly normal. It's fairly straightforward to get a nice point cloud, but getting a mesh with normal information isn't so great. I was also using heatshrink to fit this mesh with randomised polys to perfectly fit my original geometry. But even after clearing 1 and 2pt polygons, there are often overlapping and misaligned polys, and I haven't found a nice distribution that gives a good even coverage - I always seemed to end up with an uneven diastribution and empty patches. I also ended up looking for a plugin to create a mesh out of a point cloud, but no luck so far.

    BeeVee - I think your method sounds similar to MtP's suggestion, but unless I'm misunderstanding, I think the distribution of points at the end would be determined by the initial polygons? And less 'random' or 'jumbled'..?

    Sensei - I had seen your Spray BG points plugin, and it seems perfect. Sadly, (very sadly) the modeling pack is out of our budget.

    daforum - I think I've seen most of those plugins at some point Lightwave has some good tools for cloning geometry to FG object points/polys etc. It's getting a nice distribution of those points which is both random, as well as quite dense without overlapping which is causing bother...


    I'll keep playing with and testing these suggestions and see how I get on.

    Cheers,

    Derek

  15. #15
    TrueArt Support
    Join Date
    Feb 2003
    Location
    Poland
    Posts
    8,469
    Quote Originally Posted by kyuzo View Post
    dpont - Your instancer plugin looks like it can produce the exact density or pattern of instances that I need very well. The only thing I couldn't see was whether it is just a rendering effect, or if I can somehow export actual geometry from it..?
    You could try instancing 1 point polygon, and then use Item > Clone > Python Bake Instance...

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •