@carlos_m_gil_p wrote:
Hi brother.
Thank you very much for your help, time and dedication.
I have no words to thank you for what you do for me.
I will use the latest and published and will be pending to the errors.
I changed the tolerance and it did not work for me, it still makes the mirror.
And let's hope that in the future the mirrors can be improved and not be rotated.
Another question.
How did you project the 3d polyline over the 3dfaces?
Is it a lisp or did you do it by hand?
If it's a lisp, could you share it?
Of heart, thank you very much.
What I wanted to say in my last post was that you continue to use Nolo's version (without LM:int-ci-ci and ptinsidetriangle-p and with sensido and intercc turned on) - you just have to change (setq *tol* 1e-6) to (setq *tol* 1e-8)...
For projecting line of unfolded 3dfaces back to folded 3dfaces and get 3dpolyline, look into this topic, but I suggest that you login as there are animated gifs and pictures showing some actions related to descriptions in posts you may find there :
https://www.theswamp.org/index.php?topic=43121.0
To help you to get folded 3dfaces quickly from 2 3d curves, just use this simple code, I wrote imitating one of the users actually OP doing the same thing in one of animated gifs...
(defun c:23dcurves23dfaces ( / make3df adoc s1 s2 c1 c2 rev1 rev2 n k p1 d1 pl1 p2 d2 pl2 )
(vl-load-com)
(defun make3df ( p1 p2 p3 p4 )
(entmake
(list '(0 . "3DFACE")
(cons 10 p1)
(cons 11 p2)
(cons 12 p3)
(cons 13 p4)
)
)
)
(vla-startundomark (setq adoc (vla-get-activedocument (vlax-get-acad-object))))
(setq s1 (entsel "\nPick first 3d curve - side of pick must be correct..."))
(while (or (not s1) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getstartpoint (list (car s1)))))
(prompt "\nMissed or picked entity is not curve entity type... Try again...")
(setq s1 (entsel "\nPick first 3d curve - side of pick must be correct..."))
)
(setq s2 (entsel "\nPick second 3d curve - side of pick must be correct..."))
(while (or (not s2) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-curve-getstartpoint (list (car s2)))))
(prompt "\nMissed or picked entity is not curve entity type... Try again...")
(setq s2 (entsel "\nPick second 3d curve - side of pick must be correct..."))
)
(if (> (vlax-curve-getdistatpoint (setq c1 (car s1)) (vlax-curve-getclosestpointtoprojection c1 (trans (cadr s1) 1 0) (trans (getvar 'viewdir) 1 0 t))) (/ (vlax-curve-getdistatparam c1 (vlax-curve-getendparam c1)) 2.0))
(setq rev1 t)
)
(if (> (vlax-curve-getdistatpoint (setq c2 (car s2)) (vlax-curve-getclosestpointtoprojection c2 (trans (cadr s2) 1 0) (trans (getvar 'viewdir) 1 0 t))) (/ (vlax-curve-getdistatparam c2 (vlax-curve-getendparam c2)) 2.0))
(setq rev2 t)
)
(initget 7)
(setq n (getint "\nSpecify number of divisions : "))
(setq k 0)
(setq p1 (if rev1 (vlax-curve-getendpoint c1) (vlax-curve-getstartpoint c1)))
(setq d1 (/ (vlax-curve-getdistatparam c1 (vlax-curve-getendparam c1)) (1+ n)))
(setq pl1 (cons p1 pl1))
(repeat n
(setq k (1+ k))
(setq p1 (if rev1 (vlax-curve-getpointatdist c1 (- (vlax-curve-getdistatparam c1 (vlax-curve-getendparam c1)) (* k d1))) (vlax-curve-getpointatdist c1 (* k d1))))
(setq pl1 (cons p1 pl1))
)
(setq p1 (if rev1 (vlax-curve-getstartpoint c1) (vlax-curve-getendpoint c1)))
(setq pl1 (cons p1 pl1))
(setq pl1 (reverse pl1))
(setq k 0)
(setq p2 (if rev2 (vlax-curve-getendpoint c2) (vlax-curve-getstartpoint c2)))
(setq d2 (/ (vlax-curve-getdistatparam c2 (vlax-curve-getendparam c2)) (1+ n)))
(setq pl2 (cons p2 pl2))
(repeat n
(setq k (1+ k))
(setq p2 (if rev2 (vlax-curve-getpointatdist c2 (- (vlax-curve-getdistatparam c2 (vlax-curve-getendparam c2)) (* k d2))) (vlax-curve-getpointatdist c2 (* k d2))))
(setq pl2 (cons p2 pl2))
)
(setq p2 (if rev2 (vlax-curve-getstartpoint c2) (vlax-curve-getendpoint c2)))
(setq pl2 (cons p2 pl2))
(setq pl2 (reverse pl2))
(mapcar '(lambda ( a b c d ) (progn (make3df a a b c) (make3df b b c d))) pl1 pl2 (cdr pl1) (cdr pl2))
(vla-endundomark adoc)
(princ)
)P.S. You can change the code to suit your needs in case you wanted quad and not triangular folded 3DFACES...
Just change line :
(mapcar '(lambda ( a b c d ) (progn (make3df a a b c) (make3df b b c d))) pl1 pl2 (cdr pl1) (cdr pl2))
To :
(mapcar '(lambda ( a b c d ) (make3df a b c d)) pl1 (cdr pl1) (cdr pl2) pl2)
HTH., M.R.
Marko Ribar, d.i.a. (graduated engineer of architecture)