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]
Command
: TT
Select Points
<
Exit
>
Specify opposite corner:
46320
found
Select Points
<
Exit
>
Collection point...
Points collected:
46320
, time taken:
0.00
seconds.
Generate triangulation...
Generation of triangulation network completed, time taken:
5.69
seconds.
Command
:
FUNCTION:
(xdrx_points_Delaunay pts [t])
Parameter T, draw directly, otherwise return to point list
Code - Auto/Visual Lisp:
[Select]
(
defun
c:tt
(
)
(
if
(
setq
ss
(
xdrx
-
ssget
"
\n
Select Points<Exit>"
'
(
(
0
.
"point"
)
)
)
)
(
progn
(
xdrx
-
runtime t
)
(
xdrx
-
prompt
"
\n
Collection point..."
)
(
setq
pts
(
xdrx
-
getpropertyvalue ss
"position"
)
pts
(
apply
'
append
pts
)
)
(
setq
ti
(
xdrx
-
runtime
)
)
(
xdrx
-
prompt
(
xdrx
-
string
-
format
"
\n
Points collected: %d, time taken: %.2f seconds."
(
length
pts
)
ti
)
)
(
xdrx
-
prompt
"
\n
Generate triangulation..."
)
(
xdrx
-
runtime t
)
(
xdrx_points_Delaunay pts t
)
(
setq
ti
(
xdrx
-
runtime
)
)
(
xdrx
-
prompt
(
xdrx
-
string
-
format
"
\n
Generation of triangulation network completed, time taken: %.2f seconds."
ti
)
)
)
)
(
princ
)
)