Jump to content

Simplify 3D polyline


Lippens Infra

Recommended Posts

 have drawings in 3D, existing out of 3D polylines (which DO have a specific slope);
My question is: is there something like the polyline diet but for 3d polylines?
 
There is an example attached, those polylines can (in 2D) be simplified into 2 arcs each.
 
Even if there was a solution to make them out of half of the vertices, it would help a lot.
Because of the many vertices, it takes a lot to process all of the data.
 
Thanks in advance!

simplify 3dpoly.dwg

Link to comment
Share on other sites

If you want half the vertices can just get the all vertice XYZ save start and end then skip every second one, put back the new vertices. VlA-PUT big hint. Look at co-ordsxy.

 

; pline co-ords example
(defun getcoords (ent)
  (vlax-safearray->list
    (vlax-variant-value
      (vlax-get-property
    (vlax-ename->vla-object ent)
    "Coordinates"
      )
    )
  )
)


 
; convert now to xyz
(defun co-ords2xy ()
(if (= xyz 2)
(progn
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 2))
)
)
)
)

(defun getlength (ent)
      (vlax-get-property
    (vlax-ename->vla-object ent)
    "Length"
      )
)

(if (= xyz 3)
(progn
(setq I 0)
(repeat numb
(setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
(setq co-ordsxy (cons xy co-ordsxy))
(setq I (+ I 3))
)
)
)

; program starts here 3 for a 3d polyline
(if (= xyz nil)(SETQ XYZ 3))
(setq co-ords (getcoords (car (entsel "\nPlease pick pline"))))
(co-ords2xy)
(princ xy)


(princ)

 

 

  • Like 1
Link to comment
Share on other sites

Yes, Bricscad doesn't support *.vlx - but is supports *des-files (compiled *.lsp especially for Bricscad).

In case of interest contact me via www.black-cad.de

Regards

Jochen

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...