Jump to content
You must now use your email address to sign in [click for more info] ×

How to pack or fill a shape with another shape without collision? Possible?


Recommended Posts

Apologies for my lack of proper terms and understanding of math. But is there a fill mode or method that will let you fill a shape with another shape with the shapes colliding. Basically take a tear drop shape and fill with with as many circles as possible without them colliding or getting clipped by the parent tear drop shape? Like a density fill or packing.

I've included a quick illustration to help my explain and visualize my thinking.

Hope it makes sense :42_confused:

Skærmbillede 2023-05-03 kl. 12.42.12.png

Link to comment
Share on other sites

Unfortunately that functionality is not available in Affinity apps.

The closest similar functionality is Constraints in Designer, but limited to rectangular shapes and x/y axis.

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

belief-begin-conjoin: I did some experimentation with Live Filters in Photo and got the attached example, but it’s not what you asked for as some of the circles are still clipped by the shape. (I guess you could rasterise it and manually erase the bits you don’t want.)

I’ve also attached the document so you can play with it but you’ll have to figure out what I’ve done yourself as I can’t remember everything I did and not everything I did will have been necessary.

As has been mentioned above, the software isn’t designed to do this sort of thing automatically, and may never be.

I think your best bet might be to use a grid of circles over the shape and then ‘trim the fat’ where the circles aren’t wanted.

image.thumb.png.8c4e1e9d33b5f76c1baaedfa45897953.png

dots-in-a-tear-shape.afphoto

Link to comment
Share on other sites

  • Staff

Hi belief-begin-conjoin,

Unfortunately this isn't a feature, as well as the above suggestion, here's another.

Create concentric shapes within your main shape and use the text to curve feature with a filled circle glyph.

When you've got it "close enough" (it's a bit of a fiddly method) convert to curves and ungroup everything to tweak the shape positions.

The advantage of this would be the ability to alter the sizes and positions using the curve shape non-destructively until you finally convert it to curves.

Depending on the size and density this might not save you much time, but if it's quite dense I reckon it would save a bit of time. 

Lee

image.png

image.png

Link to comment
Share on other sites

One can also use some generative third-party scripting process for the shape based circle packing and then fit peaces in ADe together. - For example ...

  1. I've used a tears like silhouette shape (black filled on white bg) image as a starting point here ...
    tear.png.e7cf7366059b0f8376081635a9ddc748.png
  2. Next I let a Python script packing routine fill the above shown silhouette shape image area with some random sized vector circles, as that looks much better and can also fill small regions of that tear shape with circles. The packed circled shape result will be in my case here generated as SVG vectors  ...

    tear-circled-2.png.76cf6454efa6739381223c45c5890c18.png

    tear-2.svg


    Note: One can of course fine-adjust the circle sizes, their color, the amount of circles to use, for the shape packing generation run. I just used some simple defaults here.
     
  3. In ADe one can fit then the peaces together ...

    tear-ade.jpg.d5ff2fa47cae5a7efe207dbdff0eac69.jpg

 

All in all it's a pretty easy and reusable generation process, which can be customized via settings to produce the wanted packing result then.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

I‘m unsure if this is the same method as @LeeThorpe mentioned, but the result looks different.

Use any Shape, and convert with frame text tool to text frame shape.

Then use glyph browser to add a circular glyph, followed by blank (to allow line breaks). Duplicate those 2 characters as needed.

Set color and text width as needed. Set text alignment to center.

Notes:

  • text flow is always horizontal / left to right. But you can rotate the initial shape to any angle, click „Geometry->add“, the add text, and rotate back afterwards to create any angle for text symbols.
  • Play with text alignment (center, left, right, etc)

IMG_0457.png

shape filled with symbols.afphoto

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.