Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How can I fill a shape with circles

New Here ,
Sep 28, 2013 Sep 28, 2013

I'm trying to do following action using CS6 SDK:

1 Covert the selected path into chained circles

2 Fill the selected shapes with circles

All circles are of equal size, and cannot be overlapped each other.

Any reference/suggestions? thanks

TOPICS
SDK
4.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Participant ,
Sep 29, 2013 Sep 29, 2013

Hello,

For the first question to replace a path by circles, you could do:

Get the length of the path with the MeasureSegments function in AIPath.h.

Calculate the centers positions. Divide the length of the path by the number of circles and use functions like

GetPathBezier (from AIPath.h) and TAtLength, PointAndTangent (from AIRealBezier.h).

When you have the positions of the centers, you create the circles.

FromCapture d’écran 2013-09-29 à 18.10.03.pngtoCapture d’écran 2013-09-29 à 18.09.51.png

To fill a shape with circles, I have no idea.

JLG.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 30, 2013 Sep 30, 2013

Thanks JLG for your reply, which is very helpful.

I just realize to address my 2nd question, basically I'm facing a 2D circle packing question, which is a NP hard question, and looks currently there is no elegant solution at AFAIK.

So I'm thinking about some alternatives, like to transform a shape into equally spaced contour lines (which ends in the boundary of a shape), then covert lines into circles. Then, my question becomes how to convert a shape into equally spaced contour lines?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 07, 2013 Oct 07, 2013

Can you use a pattern brush and fill pattern? If I understand your problem correctly a brush would "replace a path" and a fill pattern would "fill a shape." You could create these assets in the document or perhaps have your plugin create them. Then have the plugin apply them to the path.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 17, 2015 Dec 17, 2015
LATEST

I periodically search for some sort of circle packing app or plugin for use with drawing and vector apps but have yet to find something that works directly with them. My current workaround is to import an image into my iPhone, use the Percolator app ( Percolator on the App Store ; Home: www.percolatorapp.com ) for circle packing, export back to my Mac, and then open and trace in AI. The results that I've gotten are pretty good. The main limitations are that the original image is limited in resolution as to what the iPhone/iPad accepts and I believe that Percolator might still be iOS-only. (I haven't seen anything similar for Android.)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines