TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => XDRX-API => Topic started by: xdcad on December 10, 2023, 02:22:13 PM

Title: [XDrX-Function(23)] Quickly build triangulation Network
Post by: xdcad on December 10, 2023, 02:22:13 PM
Code - Auto/Visual Lisp: [Select]
  1. Select Points<Exit>Specify opposite corner: 46320 found
  2. Select Points<Exit>
  3. Collection point...
  4. Points collected: 46320, time taken: 0.00 seconds.
  5. Generate triangulation...
  6. Generation of triangulation network completed, time taken: 5.69 seconds.
  7.  

FUNCTION:
(xdrx_points_Delaunay pts [t])
Parameter T, draw directly, otherwise return to point list

Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt ()
  2.    (if (setq ss (xdrx-ssget "\nSelect Points<Exit>" '((0 . "point"))))
  3.      (progn
  4.        (xdrx-runtime t)
  5.        (xdrx-prompt "\nCollection point...")
  6.        (setq pts (xdrx-getpropertyvalue ss "position")
  7. pts (apply 'append pts)
  8.        )
  9.        (setq ti (xdrx-runtime))
  10.        (xdrx-prompt (xdrx-string-format "\nPoints collected: %d, time taken: %.2f seconds." (length pts) ti))
  11.        (xdrx-prompt "\nGenerate triangulation...")
  12.        (xdrx-runtime t)
  13.        (xdrx_points_Delaunay pts t)
  14.        (setq ti (xdrx-runtime))
  15.        (xdrx-prompt (xdrx-string-format "\nGeneration of triangulation network completed, time taken: %.2f seconds." ti))
  16.      )
  17.    )
  18.    (princ)
  19. )