Author Topic: 3D experts wanted  (Read 6567 times)

0 Members and 2 Guests are viewing this topic.

Zahex

  • Guest
3D experts wanted
« on: May 12, 2005, 07:23:47 PM »
I'm working on a 3D routine and need some help

Thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
3D experts wanted
« Reply #1 on: May 12, 2005, 07:31:56 PM »
Wow, really !!
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
3D experts wanted
« Reply #2 on: May 12, 2005, 07:32:30 PM »
sorry,    da debil made me do it
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Zahex

  • Guest
3D experts wanted
« Reply #3 on: May 12, 2005, 07:38:30 PM »
can you help???

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
3D experts wanted
« Reply #4 on: May 12, 2005, 07:39:25 PM »
with what ?? What's your difficulty ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Zahex

  • Guest
3D experts wanted
« Reply #5 on: May 12, 2005, 07:48:10 PM »
it's hard to explain but basicly i want to draw a spiral through a solid.
i have a routine that defines the solid,it asks for:
1.base radius
2.top radius
3.height
4.number of polygon sides
5.insertion point

and i have  a spiral routine also,that draws spirals.
but now i first want to draw the solid and then the spiral but according to the spiral,kinda like the spiral is revolving arround the solid.

Do u understand?
should i post the routines?

Thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
3D experts wanted
« Reply #6 on: May 12, 2005, 07:53:19 PM »
Posting would be most excellent.

I have a bit to do today, so may be able to look at it tonight, If no-one else raises their hand. Chances are you will have a response before I get to look at it.

Good luck

kwb
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Zahex

  • Guest
3D experts wanted
« Reply #7 on: May 12, 2005, 07:56:12 PM »
solid:

Code: [Select]

(defun c:1 ()
  (defun Radians->Degrees (rads)
  (* rads (/ 180.0 pi))
)
  (setq radius (getdist "\n top radius: "))
  (setq baseradius (getdist "\n base radius: "))
  (setq height (getdist "\n height: "))
  (setq angRad (atan (- radius baseradius) height))
  (setq angDeg (Radians->Degrees angRad))
  (setq sides (getint "\n number of polygon sides: "))
  (setq centerpt (getpoint "\n insertion point: "))
  (setq osnaps (getvar "osmode"))
  (setvar "osmode" 0)
  (command "polygon"
  sides
  centerpt
  "C"
  (polar centerpt 0 radius)
  )
  (command "extrude" (entlast) "" height angDeg)
  (setvar "osmode" osnaps)
)




spiral:

Code: [Select]



(defun C:2()
(setq
segs (getreal "Number of segments: ")
spin -1
ri (getreal "Base radius: ")
rf (getreal "Top radius: ")
rt (getreal "Extrusion radius: "));setq   ;for the extrusion path
(setq h (getreal "Elevation: "))
(setq ns (getint "Number of spirals: "))
(setq
tu (getreal "Turns: ")
old (getvar "osmode")
fi1 (/ (* 2 PI) segs)
i 0
points (fix (* tu segs))
h1 (/ h points)
r1 (/ (- rf ri) points)
s (getpoint "Center of base: ")
end (list (car s) (cadr s) (+ h (caddr s))));setq
(setvar "osmode" 0 )
(command "line" s end "")
(command "chprop" "l" "" "c" 1 "")
(command "3dpoly")
(setq i 0)
(repeat (1+ points)
(setq
fi (* i fi1)
h (* i h1)
r (+ ri (* i r1))
x (* r (cos fi))
y (* spin r (sin fi)));setq
(command (list (+ (car s) x) (+ (cadr s) y) (+ (caddr s) h)))
(setq i (1+ i)));repeat
(command "")
(setvar "osmode" old)
(setq spiral (entlast))
(command "ucs" "n" "za" (polar s 0 ri)
(list
(+(car s) (* ri (cos fi1)))
(+(cadr s) (* spin ri (sin fi1)))h1))


;(command "circle" "0,0,0" rt)
;(command "extrude" (entlast) "" "p" spiral) ;for the extrusion path
(setvar "osmode" old)
(command "ucs" "p")


(command "array" (entlast) "" "p" s ns 360 "y")
(command "view" "swiso")
(command "_zoom" "e")
(command "shademode" "g")
); defun



even so,it would be great if you could help.

Thanks

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
3D experts wanted
« Reply #8 on: May 12, 2005, 08:26:03 PM »
You may have to explain a little better what you are trying to do.  

The prompts don't mean a lot to me.
Quote

One-element array, nothing to do.
; error: Function cancelled
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
3D experts wanted
« Reply #9 on: May 12, 2005, 08:29:25 PM »
This is what I get :

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
3D experts wanted
« Reply #10 on: May 12, 2005, 10:36:34 PM »
Kerry,
Check this out, i combined the lisp but have no idea about the 3d stuff.
http://www.theswamp.org/phpBB2/viewtopic.php?p=62392#62392

this is what it produces:
Code: [Select]
Command: zahex
._undo Enter the number of operations to undo or
[Auto/Control/BEgin/End/Mark/Back] <1>: _begin
Command:
 larger radius: 120

 smaller radius: 60

 height: 200

 number of polygon sides: 6

 insertion point: Number of spirals: 4
Extrusion radius: 25
Turns: 6


._undo Enter the number of operations to undo or
[Auto/Control/BEgin/End/Mark/Back] <1>: _end

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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
3D experts wanted
« Reply #11 on: May 12, 2005, 11:03:20 PM »
mmmm, jello.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
3D experts wanted
« Reply #12 on: May 12, 2005, 11:22:27 PM »
:shock:  :)  :)
It's past your bed time young man. 8)
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.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
3D experts wanted
« Reply #13 on: May 12, 2005, 11:38:04 PM »
But DaaAD!
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Zahex

  • Guest
Hey CAB
« Reply #14 on: May 14, 2005, 06:08:11 PM »
Hey CAB are you in here??

i've one question about the code you posted...

Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
3D experts wanted
« Reply #15 on: May 14, 2005, 06:13:49 PM »
Just passing through, headed out to early dinner.
I'll catch up tonight.
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.

Zahex

  • Guest
for later
« Reply #16 on: May 14, 2005, 06:30:06 PM »
Hey CAB:

Nice dinner?
Well,i saw you're picture and that was exactly what i wanted to do but the code you posted in another subject of mine doesn't do what appeared in the picture.In your code(c:zahex)the spiral appears in tne solid interior other thanface to face with the solid faces.
Why does that happen?
Other than that it's perfect...

Thank you

PS-i wrote this post in case i don't meet you here later

Zahex

  • Guest
forgot this...
« Reply #17 on: May 14, 2005, 07:36:14 PM »
forgot this...

example:

command prompt:"keep the (s)olid or create s(t)ructure?:" if the user choses (t) how do i define that the solid is erased so that the structure is drawn?(knowing that i have 2 defuns one for each:(defun solid) and (defun structure))

Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: for later
« Reply #18 on: May 15, 2005, 07:53:30 AM »
Quote from: Zahex
Hey CAB:

Nice dinner?
Well,i saw you're picture and that was exactly what i wanted to do but the code you posted in another subject of mine doesn't do what appeared in the picture.In your code(c:zahex)the spiral appears in tne solid interior other thanface to face with the solid faces.
Why does that happen?
Other than that it's perfect...

Thank you

PS-i wrote this post in case i don't meet you here later

Yes, thanks.

I suspect that if the picture is what you are after and you entered the responses as I did in the code above.
That is like this:
 larger radius: 120
 smaller radius: 60
 height: 200
 number of polygon sides: 6
 insertion point: Number of spirals: 4
Extrusion radius: 25
Turns: 6

The problem is most likely a system variable in your environment that is not the same as in my environment.
Upload your drawing with the attempted results using the entries above to the link at the top of this page.
In other words click on 'Lilly Pond'  above using your user name & password to upload your drawing.
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
Re: forgot this...
« Reply #19 on: May 15, 2005, 07:56:35 AM »
Quote from: Zahex
forgot this...

example:

command prompt:"keep the (s)olid or create s(t)ructure?:" if the user choses (t) how do i define that the solid is erased so that the structure is drawn?(knowing that i have 2 defuns one for each:(defun solid) and (defun structure))

Thanks

Sorry the question is unclear to me.

If you want to delete an entity you already have the name of use (entdel <entName>)
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.

Zahex

  • Guest
3D experts wanted
« Reply #20 on: May 15, 2005, 01:32:17 PM »
The program you did only works with the values you defined in your previous code?
What i mean is,it only works with these values?:
Quote

That is like this:
larger radius: 120
smaller radius: 60
height: 200
number of polygon sides: 6
insertion point: Number of spirals: 4
Extrusion radius: 25
Turns: 6


i would want it to work for all values..

thanks