POV-Ray : Newsgroups : povray.advanced-users : Trouble implementing Axis_Rotate_Trans macro Server Time
22 Dec 2024 22:54:18 EST (-0500)
  Trouble implementing Axis_Rotate_Trans macro (Message 1 to 5 of 5)  
From: Bald Eagle
Subject: Trouble implementing Axis_Rotate_Trans macro
Date: 31 May 2015 18:20:01
Message: <web.556b88e892bf08245e7df57c0@news.povray.org>
Hi all,
Sorry about dropping off the face of the Earth, and all, but there's all that
real life stuff that happens, and now I'm done whining.  About real life.  ;)

Now let me whine about my inability to get Axis_Rotate_Trans to work.  :D

Background info / goal:
I'm just trying to put a point on a twist drill, but there needs to be "relief"
trailing the cutting edge.  So I difference out a box, but then as I rotate that
box around the axis of the bit, it needs to "roll" back out of the way - and
that would be around an axis described by a vector "from" the origin "to" a
point rotated around the x-axis to the same degree as the cutting edge.

And that's where my brain, and my code craps out.

#declare Cutter2 = box {<-Drill_Size, 0, 0>, <Drill_Size, Radius*2, -1> rotate
-x*Point}
#declare Relief_Axis = vrotate (<0, Radius*2, 0>, <-Point, 0, 0>);

# declare Cone =
union {
#declare theta = 0;
#while (theta < 90)
    object {Cutter2 rotate -y*theta Axis_Rotate_Trans (Relief_Axis,
(12/90)*theta)}
    #declare theta = theta +1;
#end
}

That spits out the following error and pops up the "transforms.inc" file in a
new tab.

"C:\Documents and Settings\Drew\My
Documents\POV-Ray\v3.7\include\transforms.inc" line 60: Parse Error: Expected
'object or
directive', transform found instead

Render failed


As always, any help clearing this up would be most appreciated!


Post a reply to this message

From: scott
Subject: Re: Trouble implementing Axis_Rotate_Trans macro
Date: 1 Jun 2015 04:17:54
Message: <556c1532$1@news.povray.org>
> #declare Cutter2 = box {<-Drill_Size, 0, 0>, <Drill_Size, Radius*2, -1> rotate
> -x*Point}
> #declare Relief_Axis = vrotate (<0, Radius*2, 0>, <-Point, 0, 0>);
>
> # declare Cone =
> union {
> #declare theta = 0;
> #while (theta < 90)
>      object {Cutter2 rotate -y*theta Axis_Rotate_Trans (Relief_Axis,
> (12/90)*theta)}
>      #declare theta = theta +1;
> #end
> }
>
> That spits out the following error and pops up the "transforms.inc" file in a
> new tab.

If I add the following lines at the start then I get no error:

#local Drill_Size = 1;
#local Radius = 1;
#local Point = 1;
#include "transforms.inc"

Do you get the same result?


Post a reply to this message

From: Bald Eagle
Subject: Re: Trouble implementing Axis_Rotate_Trans macro
Date: 1 Jun 2015 22:15:08
Message: <web.556d113ee40c576d5e7df57c0@news.povray.org>
scott <sco### [at] scottcom> wrote:

> If I add the following lines at the start then I get no error:
>
> #local Drill_Size = 1;
> #local Radius = 1;
> #local Point = 1;
> #include "transforms.inc"
>
> Do you get the same result?

I already checked that I had included transforms.inc - which was also
demonstrated by my SDL crapping out IN the included code.

My setup seemed to be choking on "trasform", and I couldn't dig up any
documentation on that command, so I just cut and pasted the matrix transform
into my SDL, made a few mods, and it works.

So, no idea what the underlying problem is.   :(

Doubly annoying since that wasn't the damned axis I wanted to rotate around
anyway.  (eyeroll)

But the drill bit came out nicely.  :D


Post a reply to this message

From: Thomas de Groot
Subject: Re: Trouble implementing Axis_Rotate_Trans macro
Date: 2 Jun 2015 02:59:57
Message: <556d546d$1@news.povray.org>
On 2-6-2015 4:13, Bald Eagle wrote:
> My setup seemed to be choking on "trasform", and I couldn't dig up any
> documentation on that command, so I just cut and pasted the matrix transform
> into my SDL, made a few mods, and it works.
>
> So, no idea what the underlying problem is.   :(
>

Well, if you wrote "trasform" like in the text above, I am not surprised ;-)

Maybe use wrote "Transform"? Using capitals is a mistake I often make 
and have a hard time to hunt down. You just overlook them.


-- 
Thomas


Post a reply to this message

From: scott
Subject: Re: Trouble implementing Axis_Rotate_Trans macro
Date: 2 Jun 2015 03:29:26
Message: <556d5b56@news.povray.org>
On 02/06/2015 03:13, Bald Eagle wrote:
> scott <sco### [at] scottcom> wrote:
>
>> If I add the following lines at the start then I get no error:
>>
>> #local Drill_Size = 1;
>> #local Radius = 1;
>> #local Point = 1;
>> #include "transforms.inc"
>>
>> Do you get the same result?
>
> I already checked that I had included transforms.inc - which was also
> demonstrated by my SDL crapping out IN the included code.
>
> My setup seemed to be choking on "trasform", and I couldn't dig up any
> documentation on that command, so I just cut and pasted the matrix transform
> into my SDL, made a few mods, and it works.

My point was, if I copy & paste your text exactly as you posted into 
POV, add those lines at the beginning then it parses fine. So your 
mistake is elsewhere in some code that you haven't posted.

It's far better to post a complete block of code that you think should 
run by itself, this allows others to copy&paste into POV rather than 
trying to guess what the rest of your code is doing (I had to guess 
values for the missing parameters, no idea if changing these would cause 
the code not to parse).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.