Author Topic: Point Array (Grid) within boundary  (Read 1458 times)

0 Members and 1 Guest are viewing this topic.

mailmaverick

  • Bull Frog
  • Posts: 493
Point Array (Grid) within boundary
« on: August 18, 2017, 01:30:06 AM »
Hello

I have a closed boundary of irregular shape. I want to create a grid of POINTS at a given horizontal and vertical spacing within the boundary. Please help if anyone knows how to do it. Each Point will have Z-coordinate value as zero.


ribarm

  • Gator
  • Posts: 3265
  • Marko Ribar, architect
Re: Point Array (Grid) within boundary
« Reply #1 on: August 18, 2017, 08:52:20 AM »
I think the best way to do it, is to approximate your boundary with segmented pline and then output only points that reside inside that closed polygon... For more info, search for topic from here (theswamp), maybe something like my sub posted here :
https://www.theswamp.org/index.php?topic=48399.msg574466#msg574466

 :straight:
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

ribarm

  • Gator
  • Posts: 3265
  • Marko Ribar, architect
Re: Point Array (Grid) within boundary
« Reply #2 on: August 18, 2017, 09:18:38 AM »
Oh, I forgot ab internal islands... Then something like this procedure : convert your boundaries to regions, then do subtraction of all islands regions from main outer region... Then convert that main region to surface... Then finally iterate through all grid points and check weather line with start point (x y -1.0) and end point (x y 1.0) imprints that surface... If that's true imprint command have option to erase imprinted curve, so you should specify inside (command "_.IMPRINT" ... "_Y") - "_Y" - yes option to erase that curve... Then just do the check : (if (and li (vlax-erased-p li)) -> entmake grid point... - else if (li - line) exist, just (entdel li)... I know that this procedure is so sloow, but it'll do exactly what you need at the end... And no need for approximation : regions and planar surface created from region is accurate enough for curving representation...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

VovKa

  • Water Moccasin
  • Posts: 1629
  • Ukraine
Re: Point Array (Grid) within boundary
« Reply #3 on: August 18, 2017, 10:01:28 AM »
It reminds me the "garden path" app from visual lisp tutorial