Skip navigation
Teekosey
Currently Being Moderated

Shapes within shapes

Apr 30, 2013 2:47 AM

Morning, i am trying to put shapes within another shape.  So that if i drew a random shape say with the pen tool and wanted to insert a completly different shape within that would fill to the size and shape of the shape. Rather than being cut off by the parent shape. I have manually prepared a simple picture in a crude fashion to illustrate the kind of technique i want to achieve. If you see below i want to achieve the first example rather than example 2 or 3.  Is this possible? I hope that i have managed to explain clear enough !  Many thanks in advance for any assistance.

 

shap.jpg

 
Replies
  • Currently Being Moderated
    Apr 30, 2013 4:04 AM   in reply to Teekosey

    Teekosey,

     

    With View>Smart Guides on, you may:

     

    0) Crate the star shape (presumably, you have already);

    1) Copy the star shape to the front (Ctrl/Cmd+C+F) and Object>Path>Average (this will create an auxiliary star with 0 size);

    2) Create a circle with a W = H twice the inner radius of the star (or make a temporary size and resize it like in 5) below);

    3) Drag the circle by its centre to align with the centre of the star average (Smart Guides say anchor), now this centre circle will fill the inner star part;

    4) Create a smaller circle and drag it by the bottom Anchor Point to snap to the top of the centre circle;

    5) Zoom in and with the Scale Tool, click the bottom Anchor Point and drag a suitable point on the circle at 45 degrees up and to the right to scale uniformly outwards (or inwards if the circle is too large) until it matches the star path (Smart Guides say intersect); if you have chosen a wrong point drag again until you have the right one and there is only one intersection, which you can see by selecting both the circle and the star;

    6) Repeat for the next circles until you have enough;

    7) Create a circle larger than the star and centre it round the star average;

    8) Select the larger circle and the circles made in 5)-6) and rotate 4 copies by 72 degrees;

    9) Delete the larger circle and the star average.

     

    The star average is the centroid of the star, different from the centre of the Bounding Box.

     

    You can rotate in other ways.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2013 5:13 AM   in reply to Teekosey

    Ah, Teekosey.

     

    I looked (too much) at the OP image.

     

    As far as I remember there is a script or something that makes this kind of stuffing. Someone may be able to point you to it.

     

    Someone?

     

    Otherwise, it is manual work, starting with certain circles and then adding others, which can be made in a similar way as with the star shape.

     

    But there are some decisions, such as the extent to which you wish to have single circles filling the outer shape, like to the left in your post#2 image, or more smaller circles, like at the right.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2013 6:08 AM   in reply to Teekosey

    Teekosey,

     

    In that case,

     

    Unless someone presents a script for it, you may start with the overall shape, then place and size the basic fill shape where you want it (first), then create and resize and place each copy (dragging it round to fit) in an iterative process.

     

    In this connexion, an approximate fit withing the overall shape may be good enough.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2013 6:18 AM   in reply to Teekosey

    If all you need is circles, try this: http://forums.adobe.com/thread/732621

     

    In case you need to manually align stuff, try the ColliderScribe plugin.

     

    You might also take a look at this method: http://www.vektorgarten.de/align-and-distribute-pathfinder.html

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 30, 2013 8:42 AM   in reply to Teekosey

    Teekosey,

     

    That was the script I was thinking of.

     

    Let us hope that Theunis sees this thread and makes a customized script.

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2013 3:17 AM   in reply to Jacob Bugge

    Jacob Bugge wrote:

     

    That was the script I was thinking of.

     

    Let us hope that Theunis sees this thread and makes a customized script.

     

    Ouch!

     

    Teekosey, my script works because Circles are Easy. The computationally intensive problem is: if you are placing objects at random, how do you determine overlap, so you can prevent it? With circles, this is "easy": given a random center (x,y) and a radius r, you can compare the distance to every other circle using basic maths (Pythagoras). If this circle one is too near to another, decrease its radius until it just touches the other one.

     

    Plain Maths works with some other basic shapes -- rectangles, for example -- but definitely not with any random shape. In that case you need to check for every single point if it's "inside" all other objects. And then even if you don't find any "inside" points, objects may still overlap:

    overlap.PNG

    The required math is way beyond my capabilities ... also, even if it's possible to write a script for this, I'm pretty sure it would be incredibly slow.

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2013 3:41 AM   in reply to [Jongware]

    Thank you for clearing this up, Theunis.

     

    I had a hope, but I see.

     

    So it is back to careful work, which is (fundamentally) far from bad.

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2013 7:15 AM   in reply to Teekosey

    The image with the circles is the techinque that i am looking for ! But not with circles but with a shape i create with the pen tool.

    As mentioned, there is no collision detection function provided in Illustrator's scripting model (although there should be). Illustrator's Symbols feature provides for replacing existing Instances with instances of another Symbol, but does not provide for replacing ordinary objects with Symbols (although it should).

     

    It is, however, fairly trivial to script the replacement of selected pageItems with Symbol Instances. So you could still use the Jongware fill-with-circles script, and then script the replacement of the circles with some other object you've drawn and stored as a Symbol. It just largely depends on the aspect ratio (proportional "roundness" or squareness) of the specific artwork involved:

     

     

    Depending on whether you want to allow objects to touch or overlap, Transform Each can also assist with the results:

     

     

    So you need to show the kind(s) of object(s) you actually have in mind.

     

    JET

     
    |
    Mark as:
  • Currently Being Moderated
    May 4, 2013 2:02 PM   in reply to JETalmage

    Ooh James, that's an excellent idea! Is there already a script for that?

     

    Yes, I see how it depends on the shapes to be used. Anything deriving too much from my circles will leave large gaps.

     
    |
    Mark as:
  • Currently Being Moderated
    May 16, 2013 2:40 PM   in reply to Teekosey

    A fine working version of a script that can swap objects can be found here at Kelso's script repository (link).

     
    |
    Mark as:
  • Currently Being Moderated
    May 17, 2013 6:28 AM   in reply to Teekosey

    It should work like this:

    1) make sure the new object (that will replace the circles) is the top most object in the layer stack.

    2) select this object and the circles

    3) run the script

     

    If you keep running into errors, try copying the objects to a new, empty file and repeat the proces. I can't script at all, so I can't tell you why the error occurs. It works fine over here, though.

    Good luck!

     
    |
    Mark as:
  • Currently Being Moderated
    May 18, 2013 12:43 PM   in reply to Teekosey

    I'm sorry, like I said, I don't script myself so I can't help you.

    Maybe you can try John Wundes' script Copy to objects (scroll down to find it), which aims to do the same.

     

    Better luck this time - otherwise I'm fresh out of ideas

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 3, 2013 4:37 AM   in reply to Teekosey

    I'm looking for such a function too, either Illustrator (CS6) or any other programm.

     

    As in this picture:

    http://images.gutefrage.net/media/fragen/bilder/mit-was-fuer-einen-pro gramm-wurde-die-schrift-gemacht/0_big.jpg

    The text is the shape and filled with 1 diamond that got duplicated and resized to fit the shape outlines. And by standard Illustrator cannot do something like this (it seems simple)?

     

    It would be tedious to make this manually, so there must be a programm/tool/function that is able to perfom this.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 3, 2013 5:30 AM   in reply to Mopsi Leet

    It would be tedious to make this manually, so there must be a programm/tool/function that is able to perfom this.

    Really?

     

    I've been making a living doing tedious things manually with drawing software for about 30 years. That means there must be an automagic one-click function for doing them all?

     

    JET

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 3, 2013 4:37 PM   in reply to JETalmage

    Probaly there is one somewhere, are you looking for one? Maybe I do know a thing or two. If it's image or video related, no coding.

     

    Till some months ago I didn't know collages could be automatically formed in a shape... in any shape I want, and that even with freeware (Shape Collage v2.1) in excellent quality and adjustable settings and PSD output with every picture on its own layer.

     

    I was looking for something I could use to make a large poster of a cat (many pictures  in a cat shape). And that tool saved me a lot of tedius work

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points