Author Topic: [XDrX-Function(25)] Point set generation convex hull (5 functions)  (Read 282 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 505
xdrx_points_QHull
xdrx_points_MHull  (divide and conquer algorithm)
xdrx_points_GHull  (Scan algorithm)
xdrx_points_GHull1 (Scan algorithm)
xdrx_points_CHull (Double-headed chain algorithm)

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 "\nCalculate minimum distance point pairs...")
  12.        (xdrx-runtime t)
  13.        (setq info (xdrx_points_QHull pts))
  14.        (xdrx-polyline-make info)
  15.        (xdrx-setpropertyvalue (entlast) "color" 1)
  16.        (setq ti (xdrx-runtime))
  17.        (xdrx-prompt (xdrx-string-format "\nCalculation completed, time taken: %.2f seconds." ti))
  18.      )
  19.    )
  20.    (princ)
  21. )
« Last Edit: December 10, 2023, 05:20:59 PM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net