Fill Color Imported CAD Shape

Started by JuneTheSecond, June 09, 2010, 08:18:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JuneTheSecond

Because Yacine's solution to the "Can't fill simple CAD shape" is very cool,
I've completely copied his steps into a macro.
This macro simply follows his steps, but never automates the steps.
But you can really fill the shape that is uploaded at the thread,
if you have the patience to follow the long sequence of dialogs,
pressing Yes button or No button.
The essence of Yacine's solution is a set of "Trim and Join".
And I am sorry I did not checked whether this macro can fill any other CAD shape.
Detailed description is written on the drawing.
URL of "Can't fill simple CAD shape" is
http://visguy.com/vgforum/index.php?topic=1812.0

Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

#1
Thank you for the flowers Sensei.
Your solution is much cooler. 8) Very cool and helpful.

However, since you feel challenged by the issue, I thought I could give some more input.
If you watch the shapesheet of the original shape you will notice some oddities:
- moveto rows following each other
- moveto rows at the end of a geometry section

Would it help to just remove these oddities and do the normal operations afterward - trim, join and fill ?
Yacine

Yacine

@David,
can you send us more CAD "crap", so we can analyse it and "may be" work out a better solution?
Yacine

JuneTheSecond

As far as Master.2, all oddies are removed when you trim the dropped shape.
All trimed fragments seems automatically converted to normal shapes.  
Really nice power of "Trim"! ;) ;) ;) ;)
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

I guess I was not clear enough, sorry.
I wanted to say, that if the odd lines, were removed by macro prior to any trimming, may we would not need additional steps.

Now, I tried it, by removing manually the odd rows ... and it did not work.

2nd approach: would a macro that unifies all the geometry sections, be able to setup a propper shape?
Yacine

JuneTheSecond

The reason of two stages is that this is just my first study.
It may be possible to remove first stage  to delete simple lines or integrate two stages  into one.
Simple step might reduce users' job. :) :) :)
Best Regards,

Junichi Yoda
http://june.minibird.jp/

JuneTheSecond

#6
I tried to make more simple macro, but failed.
The ide was to duplicate the dropped down shape directly,
and trim the overlayed 2 shapes.
You can delete all odd lines directly.
But when you join once or twice all fragments into one,
some parts deleted unexpectedly.  ??? ??? ???
Best Regards,

Junichi Yoda
http://june.minibird.jp/

JuneTheSecond

#7
Here is another macro after study about "Fragments and Union" at
http://visguy.com/vgforum/index.php?topic=1812.msg8270;topicseen#msg8270
How would you like this macro?
Best Regards,

Junichi Yoda
http://june.minibird.jp/

JuneTheSecond

Above macro has problems.
1. The fragments inside the curves are often corrupted.
2. The holes in the shape are filled.

To solve 1, you need repeat "Join and Fragment" to each pair of touching fragment in multiple times hopefully more than 2 or 3 times or more.
To solve 2, you need to delete all fragments in the holes before final "Union" .

Next macro is such one that takes in these steps.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

JuneTheSecond

Additional images with explanation.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

JuneTheSecond

If shape is simple and has no hole, operation on this macro are simple and easy.
If shape is more complicated and have holes, you need to be more carefull.
Very offten you need to increase the number of repeat of "Join and Fragment" with spin button on the dialog.
Best Regards,

Junichi Yoda
http://june.minibird.jp/