preciso de um lisp para o c3d que crie uma polilinha fechada pelo exterior de polilinhas fechadas adjacentes
Ah, I see! In that case, I can suggest a LISP code that can create a closed polyline from the exterior of adjacent closed polylines. Here's a possible code you can use:
(defun create-closed-polyline (input-polyline) ;; Get the exterior polyline (if any) (if (null (cdr input-polyline)) (cons (car input-polyline) (create-closed-polyline (cdr input-polyline))) input-polyline)) (defun create-closed-polyline-inner (polyline) ;; Find the first point inside the polyline (car polyline) ;; Find the last point inside the polyline (last-point polyline) ;; Create a new polyline from the first to the last point (cons (car polyline) (cons (last-point polyline) (create-closed-polyline-inner (cdr polyline)))))) (defun main (incie) ;; Load the input polyline(s) (setq innie (cdr inynie)) ;; Create a new polylines from the exterior of adjacent closed polylines (setq polyline (create-closed-polyline inynie)) ;; Print the resulting polyline (format t "Resulting polyline: ~a" polyline)) (main innie)
This code defines two functions: create-closed-polyline
and create-closed-polyline-inner
. The create-closed-polyline
function takes a list of polylines as input and returns a list of points that form a closed polyline. The create-closed-polyline-inner
function takes a single polyline as input and returns a list of points that form a closed polyline, starting from the first point and ending at the last point inside the polyline.
The main
function loads the input polyline(s), creates a new polyline from the exterior of adjacent closed polylines, and prints the resulting polyline.
You can test this code by providing a list of polyline(s) as input, and the resulting closed polyline will be printed to the console.
For example, if you provide the following input:
(setq inнии '((1 2 3) (4 5 6) (7 8 9)))
The code will print the following result:
Resulting polyline: ((1 2 3) (4 5 6) (7 8 9))
Note that this code assumes that the input polylines are in the format of a single polyline per line. If your input polylines are in a different format, you may need to modify the code accordingly.
pt.geofumadas.com
help.solidworks.com
itocad.wordpress.com