Author Topic: Brick lines on louvers  (Read 10256 times)

0 Members and 1 Guest are viewing this topic.

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Brick lines on louvers
« on: March 10, 2004, 12:52:01 PM »


That's what I need to add.  Here is a drawing which explains how we perform this...but it's tedious...any ideas on a way to go to "Do it with LISP?"
http://theswamp.org/lilly.pond/Dommy2Hotty/BrickLinesOnLouvers.dwg

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Brick lines on louvers
« Reply #1 on: March 10, 2004, 12:56:02 PM »
A simple solution would be to draw a single line and polar array for a fill effect. You will have to calculate the spacing based on the length of the chord, but it should not be too difficult.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Brick lines on louvers
« Reply #2 on: March 10, 2004, 01:03:41 PM »
The only problem with that is depending on the size of louver...the spacing around the perimeter with different sizes would still be the same, that's why we create the circles and copy them around the outer circle (described in the drawing).  That way no matter what the outer diameter is, the spacing will remain the same around the perimeter, but the number of lines will increase/decrease with diameter.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Brick lines on louvers
« Reply #3 on: March 10, 2004, 02:26:49 PM »
I am trying to understand you method.
Looking at your drawing I downloaded the example showing all the circles that is
the one bottom center of the six lovers in progress. The spokes are not aligned
with circles. Was that drawn correctly?
In that example you used the outer diameter of the lover to place your circles,
but in the half round version on the bottom of the drawing you used the inner arc
to establish your spacing. So i am confused as to the exact method you use.

And why 2.666 as the spacing amount? Just curious.

CAB
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Brick lines on louvers
« Reply #4 on: March 10, 2004, 02:44:04 PM »
Quote from: CAB
I am trying to understand you method.
Looking at your drawing I downloaded the example showing all the circles that is
the one bottom center of the six lovers in progress. The spokes are not aligned
with circles. Was that drawn correctly?


Actually, crap...I mirrored one quater of it around to save time and didn't check it...my bad...shoulda drawn each of them individually, how we normally would...sorry...

Quote from: CAB
In that example you used the outer diameter of the lover to place your circles,
but in the half round version on the bottom of the drawing you used the inner arc
to establish your spacing. So i am confused as to the exact method you use.


The louver is how it should be done...the half round was a block that I inserted just to show another example of, but I didn't check to make sure the block was drawn correctly...my bad yet again

Quote from: CAB
And why 2.666 as the spacing amount? Just curious.


Pretty much because my boss said so...I was told it is the distance of the bricks w/mortar...

 :twisted:  :twisted:  :twisted:  :twisted:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Brick lines on louvers
« Reply #5 on: March 10, 2004, 03:29:24 PM »
Looks interesting... I have a little something that creates a very similar thing, but no bricks, I will see if I can add them and tweak it a bit.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Brick lines on louvers
« Reply #6 on: March 10, 2004, 08:32:56 PM »
Well, give this a try.. :)


CAB

Code: [Select]
(defun c:spokes (/       arcsin  p1      p2      p3      r1
                 r2      lnstart lnend   ang     angoff  circ
                 usrosmode
                )
  (defun arcsin (z /)
    (atan z (sqrt (- 1.0 (* z z))))
  )
  (if (setq p1 (getpoint "\nPick the center."))
    (if (setq p2 (getpoint "\nPick the inner circle."))
      (if (setq p3 (getpoint "\nPick the outer circle."))
        (progn
          (setq up      (* pi 0.5)       ; 90 deg
                r1      (distance p1 p2) ; inner radius
                r2      (distance p1 p3) ; outer radius
                lnstart (polar p1 up r1) ; line pt
                lnend   (polar p1 up r2) ; line pt
                ang     up
                angoff  (* 2 (arcsin (/ 1.3333 r2))) ; offset angle
                circ    (* pi (* r2 2)) ; circumference
          )
          (command ".undo" "begin")
          (setq usrosmode (getvar "osmode"))
          (setvar "osmode" 0)
          (repeat (1+(fix (/ circ 2.6666)))
            (command ".line" lnstart lnend ""); line segment
            (setq ang     (+ ang angoff) ; next angle
                  lnstart (polar p1 ang r1) ; next line pt
                  lnend   (polar p1 ang r2) ; next line pt
            )
          ) ; end repeat
          (setvar "osmode" usrosmode)
          (command ".undo" "end")
        ) ; end progn
      ) ; endif
    ) ; endif
  ) ; endif
  (princ)
) ; end defun
(prompt "\nSpokes.lsp loaded, enter spokes to run.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Brick lines on louvers
« Reply #7 on: March 11, 2004, 10:16:23 AM »
HOLY CRAP!!! :shock:  :shock: CAB...THANK YOU...do you realize my boss has been doing it the long way for probably the better part of a decade?  That works perfectly...I only used it on one size so far, but that one time of using it took me 5 seconds instead of about 5 minutes...just awesome...thanks...thanks!!  :twisted:

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Brick lines on louvers
« Reply #8 on: March 11, 2004, 10:37:43 AM »
I need to ask one more favor...is there a way to set a start and end point for when doing arches, as in the following picture, so that it will only create the lines within the arch? :twisted:


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Brick lines on louvers
« Reply #9 on: March 11, 2004, 10:37:56 AM »
My pleasure.

Long live LISP :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Brick lines on louvers
« Reply #10 on: March 11, 2004, 12:26:33 PM »
This is a quickie, so some improvements are to be had.

Code: [Select]
;;;===============================================================
;;;                 Spokes.lsp
;;;               Charles Alan Butler
;;;             ab2draft@TampaBay.rr.com
;;;               03/11/2004 Ver alpha
;;;
;;;    Routine to create line segments in a radial pattern
;;;        by picking the center and two circles
;;;================================================================
;;;
;;;   ARGUMENTS NONE
;;;
(defun c:spokes (/        arcsin   p1       p2       p3       ps
                 pe       fill     r1       r2       lnstart  lnend
                 ang      angoff   circ     usrosmode
                 linesegment       arclength
                )
;;; -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=-
;;;                      Local Functions                          
;;; -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=-
  (defun arcsin (z /)
    (atan z (sqrt (- 1.0 (* z z))))
  )
  ;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  (defun linesegment ()
    (command ".line" lnstart lnend "") ; line segment
    (setq ang     (+ ang angoff) ; next angle
          lnstart (polar p1 ang r1) ; next line pt
          lnend   (polar p1 ang r2) ; next line pt
    )
  )
  ;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  (defun arclength (/ 1sta 2nda arl rang)
    ;;Calculates 1st ANGLE
    (setq 1sta (angle p1 (polar p1 (angle p1 ps) r2)))
    ;;Calculates 2nd ANGLE
    (setq 2nda (angle p1 (polar p1 (angle p1 pe) r2)))

    (if (< 1sta 2nda)
      (progn (setq rang (- 2nda 1sta)) ;ANGLE IN RADIANS
             (setq arl (* r2 rang)) ;ARC LENGTH
      ) ;_ end of progn
      (progn (setq rang (+ (* 2 pi) (- 2nda 1sta))) ;ANGLE IN RADIANS
             (setq arl (* r2 rang)) ;ARC LENGTH
      ) ;_ end of progn
    ) ;_ end of IF
  )

;;; -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=-
;;;================================================================
;;;                    Start of Routine                            
;;;================================================================
;;; -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=- -=<*>=-
  (initget "Arc Circle")
  (if
    (setq fill (getkword "\nFull circle or Arc only [Circle/Arc]<C>"))
     (if (= fill "Arc")
       (progn
         (prompt "\nPoints are picked in a counter clock wise rotation.")
         (setq
           ps (getpoint "\nPick start point on right end of the arc.")
         )
         (setq pe (getpoint "\nPick end point on left end of the arc."))
       ) ; end progn
     ) ; endif
     (setq fill "Circle")
  ) ; endif
  (if (setq p1 (getpoint "\nPick the center."))
    (if (setq p2 (getpoint "\nPick the inner circle."))
      (if (setq p3 (getpoint "\nPick the outer circle."))
        (progn
          (setq up      (* pi 0.5) ; 90 deg
                r1      (distance p1 p2) ; inner radius
                r2      (distance p1 p3) ; outer radius
                lnstart (polar p1 up r1) ; line pt
                lnend   (polar p1 up r2) ; line pt
                ang     up
                angoff  (* 2 (arcsin (/ 1.3333 r2))) ; offset angle
                circ    (* pi (* r2 2)) ; circumference
          )
          (if (or (= fill "Circle") (and (= fill "Arc") ps pe))
            (progn
              (command ".undo" "begin")
              (setq usrosmode (getvar "osmode"))
              (setvar "osmode" 0)
              (if (= fill "Circle")
                (repeat (1+ (fix (/ circ 2.6666)))
                  (linesegment)
                ) ; end repeat
                (progn
                  (setq numofseg (/ (fix (/ (arclength) 2.6666)) 2)
                        lnstart  (polar p1 ang r1) ; line pt
                        lnend    (polar p1 ang r2) ; line pt
                  )
                  (repeat (1+ numofseg)
                    (linesegment)
                  )
                  (setq ang     up
                        lnstart (polar p1 ang r1) ; line pt
                        lnend   (polar p1 ang r2) ; line pt
                  )
                  (repeat numofseg
                    (setq ang     (- ang angoff) ; next angle
                          lnstart (polar p1 ang r1) ; next line pt
                          lnend   (polar p1 ang r2) ; next line pt
                    )
                    (command ".line" lnstart lnend "") ; line segment
                  )
                )
              ) ; endif
              (setvar "osmode" usrosmode)
              (command ".undo" "end")
            ) ; end progn
            (alert "\nError. No Arc points.")
          ) ; endif
        ) ; end progn
      ) ; endif
    ) ; endif
  ) ; endif
  (princ)
) ; end defun
(prompt "\nSpokes.lsp loaded, enter spokes to run.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Dommy2Hotty

  • Swamp Rat
  • Posts: 1127
Brick lines on louvers
« Reply #11 on: March 11, 2004, 04:14:04 PM »
CAB...I take back all the bad things I've ever said about you...ok...I never said anything bad about you...and I never will...because that lisp ROCKS!!! :dood: Thank you so much  :twisted:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Brick lines on louvers
« Reply #12 on: March 11, 2004, 10:51:39 PM »
D2H..... Now, as is the Lisp guru's creed, you must use this lisp for at least a few months, perhaps even a year before you let anyone know you have it. If and when you finally do let your boss know about, make darn sure that you tell him that it has been taking you only a few seconds to do each of these, and that the program costed you personally alot of time and effort. Then let him know that the author would like to be compensated for the licensing fee that has not yet been paid, because the free time period has ran out. "It has already saved the company $xxx and potentially can save another $xxx in the next year." "The licensing fee is only $150 per seat and you need to make it available for everyone."
Then have them send CAB a check for his gracious help in this matter....Heck, I believe he has earned it many times over....
Just my thoughts...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

daron

  • Guest
Brick lines on louvers
« Reply #13 on: March 12, 2004, 07:36:34 AM »
Definately that :dood:

DEVITG

  • Bull Frog
  • Posts: 479
Brick lines on louvers
« Reply #14 on: March 12, 2004, 08:56:29 PM »
Hi cab , sure it work .

Would you please tell me why I get this error when checking .


Quote
[CHECKING TEXT spokes.LSP loading...]
.
; warning: local variable used as function: ARCSIN
; warning: local variable used as function: LINESEGMENT
; warning: local variable used as function: ARCLENGTH
; warning: local variable used as function: LINESEGMENT
..
; Check done.

:oops:
Location @ Córdoba Argentina Using ACAD 2019  at Window 10

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Brick lines on louvers
« Reply #15 on: March 12, 2004, 09:17:40 PM »
The local function names are declared to keep them local.
You may remove the names if you want as shown below.
It just keeps them from colliding with anything else you
may be running and using the sane names.

Code: [Select]
(defun c:spokes (/          p1       p2       p3       ps
                 pe       fill     r1       r2       lnstart  lnend
                 ang      angoff   circ     usrosmode
                )


Look here for more info.

CAB
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Brick lines on louvers
« Reply #16 on: March 12, 2004, 11:16:18 PM »
that is telling you that the functions that have been defined within the main program are localized to the program only ...
Code: [Select]

(defun thisprog (/ local1 local2)
 (defun local1 ()
  (do this stuff)
 )
 (defun local2 ()
  (do that stuff)
 )
)


This would generate that warning because the defun local1 and local2 are not only defun'd as a nested function of thisprog,  but are also explicitly listed as local in the localize variable list.

Essentially it is telling you that the localized variable local1 is later being defun'd ....
That is inherent with this technique...
It should still operate flawlessly
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Brick lines on louvers
« Reply #17 on: March 13, 2004, 11:06:54 PM »
More food for thought Here
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Anonymous

  • Guest
Brick lines on louvers
« Reply #18 on: March 16, 2004, 01:10:54 PM »
@DEVITG ...that's because you have declared a defined function as a local variable in your main routine...take a look a the thread "Poco Loco" SMadsen does an excellent job of explaining it! :wink:

SMadsen

  • Guest
Brick lines on louvers
« Reply #19 on: March 16, 2004, 02:27:54 PM »
Guest, thanks :)

Thanks CAB for pointing to the excellent discussion on adesk ng ('cept for the last question heh)