Author Topic: Region meshing  (Read 2367 times)

0 Members and 1 Guest are viewing this topic.

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Region meshing
« on: June 03, 2014, 04:31:35 PM »
It is necessary to mesh the target regions. Each output "cell" must to be a region too. It is not difficult for common cases:



But sometime some output regions can to be consisting of several parts:



I need exclude such results. Each output region must to be as a single one. How can I to separate such regions to the certain regions?

Can I create the Region based on a Face object from the Brep.Faces collection?
« Last Edit: June 03, 2014, 04:40:25 PM by Andrey Bushman »

SEANT

  • Bull Frog
  • Posts: 345
Re: Region meshing
« Reply #1 on: June 03, 2014, 06:20:22 PM »
If the Brep of the Region has more than one Complex, Explode the Region.  That should return a DBObjectCollection of Regions that were the individual pieces of the original.  Delete the original Region if necessary.
Sean Tessier
AutoCAD 2016 Mechanical

Andrey Bushman

  • Swamp Rat
  • Posts: 864
Re: Region meshing
« Reply #2 on: June 04, 2014, 03:17:43 AM »
If the Brep of the Region has more than one Complex, Explode the Region.  That should return a DBObjectCollection of Regions that were the individual pieces of the original.  Delete the original Region if necessary.
Thank you! Explode works fine! In my code I cheked the Faces instead of Complex.
Code - C#: [Select]
  1. using(Br.Brep brep = new Br.Brep(rowClone)) {
  2.   if(brep.Faces != null && brep.Faces.Count() > 1) {
  3.     using(Db.DBObjectCollection explodeResult =
  4.       new Db.DBObjectCollection()) {
  5.       rowClone.Explode(explodeResult);
  6.       foreach(Db.DBObject item in explodeResult) {
  7.         result.Add((Db.Region)item);
  8.       }
  9.     }
  10.  
  11.     if(!rowClone.IsDisposed)
  12.       rowClone.Dispose();
  13.   }
  14.   else
  15.     result.Add(rowClone);
  16. }
Can I get a problem this case?

SEANT

  • Bull Frog
  • Posts: 345
Re: Region meshing
« Reply #3 on: June 04, 2014, 06:24:49 AM »
For Regions that probably will work.
Sean Tessier
AutoCAD 2016 Mechanical