Author Topic: 3DFACE hidden sides  (Read 2025 times)

0 Members and 1 Guest are viewing this topic.

TopoWAR

  • Newt
  • Posts: 135
3DFACE hidden sides
« on: April 21, 2012, 04:36:10 PM »
I could not, I have hours with this problem, a lisp that tells me which side of 3DFACE are visible or hidden,
thanks
Thanks for help

efernal

  • Bull Frog
  • Posts: 206
Re: 3DFACE hidden sides
« Reply #1 on: April 21, 2012, 06:13:48 PM »
(70 . 0) all visibles
(70 . 1) first hidden
(70 . 2) second hidden
etc...
e.fernal

TopoWAR

  • Newt
  • Posts: 135
Re: 3DFACE hidden sides
« Reply #2 on: April 21, 2012, 06:17:09 PM »
efernal , not, is the sum of the values, I do not know how to do the lisp.
I want a function that returns only the visible side, I hope someone help me
Thanks for help

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: 3DFACE hidden sides
« Reply #3 on: April 21, 2012, 06:27:28 PM »
DXF 70 is bit-coded, demo:

Code - Auto/Visual Lisp: [Select]
  1. (defun _HiddenEdges ( 3DFaceEntity )
  2.     (
  3.         (lambda ( x )
  4.             (apply 'append
  5.                 (mapcar
  6.                     (function
  7.                         (lambda ( b )
  8.                             (if (< 0 (logand (car b) x)) (cdr b))
  9.                         )
  10.                     )
  11.                    '(
  12.                         (1 "1st edge is invisible")
  13.                         (2 "2nd edge is invisible")
  14.                         (4 "3rd edge is invisible")
  15.                         (8 "4th edge is invisible")
  16.                     )
  17.                 )
  18.             )
  19.         )
  20.         (cdr (assoc 70 (entget 3DFaceEntity)))
  21.     )
  22. )

Code - Auto/Visual Lisp: [Select]
  1. (_HiddenEdges (car (entsel)))
« Last Edit: April 21, 2012, 06:38:23 PM by Lee Mac »

TopoWAR

  • Newt
  • Posts: 135
Re: 3DFACE hidden sides
« Reply #4 on: April 21, 2012, 06:33:38 PM »
Lee Mac , you are great teacher :-D
Thanks for help

Lee Mac

  • Seagull
  • Posts: 12913
  • London, England
Re: 3DFACE hidden sides
« Reply #5 on: April 21, 2012, 06:38:54 PM »
Thank you TopoWAR, happy coding!  :-)