|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
ver 3.7
code:
isosurface {
function{
val("1.5")
// 5
}
contained_by { box { -2, 2 } }
}
error:
line 3: Parse Error: Expected 'operand', string literal found instead
Way?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 06.07.2014 16:25, schrieb deep125:
>
> isosurface {
> function{
> val("1.5")
> // 5
>
> }
> contained_by { box { -2, 2 } }
> }
>
>
> error:
> line 3: Parse Error: Expected 'operand', string literal found instead
> Way?
Some statements are not available inside user-defined functions, because
they typically don't make much sense there, or would have been
unnecessarily difficult to implement; after all, these functions must be
"compiled" into a bytecode and then executed by some virtual machine at
run-time. A virtual machine which had to be specifically implemented for
this task, as there was no such thing as LLVM back in those dark ages.
(I wouldn't be too surprised if it even predates the Java VM.)
In your case, you can easily work around this limitation by using:
isosurface {
#declare V = val("1.5");
function { V }
...
}
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
clipka <ano### [at] anonymousorg> wrote:
>>...
> Some statements are not available inside user-defined functions,
>>...
Thanks!
Where can I see list available statements?
I'm interested in use splines!
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Am 07.07.2014 07:21, schrieb deep125:
> clipka <ano### [at] anonymousorg> wrote:
>>> ...
>> Some statements are not available inside user-defined functions,
>>> ...
>
> Thanks!
>
> Where can I see list available statements?
>
>
> I'm interested in use splines!
Splines have a function-like interface, so IIRC they are fully supported
in functions.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
> Splines have a function-like interface, so IIRC they are fully supported
> in functions.
Code:
----------
#declare MySpline=spline
{
linear_spline
1 , <0,0,0>
2 , <2,2,2>
}
isosurface {
function{
MySpline(1).x
}
contained_by { box { -2, 2 } }
}
-------------------
Error
Parse Error: Expected 'operand', spline identifier found instead
How to attach a spline?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"deep125" <dee### [at] yandexru> wrote:
> > Splines have a function-like interface, so IIRC they are fully supported
> > in functions.
>
> Code:
> ----------
>
> #declare MySpline=spline
> {
> linear_spline
> 1 , <0,0,0>
> 2 , <2,2,2>
>
> }
>
> isosurface {
> function{
> MySpline(1).x
> }
> contained_by { box { -2, 2 } }
> }
> -------------------
>
> Error
>
> Parse Error: Expected 'operand', spline identifier found instead
>
> How to attach a spline?
How about reading the documentation?
http://www.povray.org/documentation/view/3.6.1/231/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 07/08/2014 10:50 AM, deep125 wrote:
>> Splines have a function-like interface, so IIRC they are fully supported
>> in functions.
>
> Code:
> ----------
>
> #declare MySpline=spline
> {
> linear_spline
> 1 , <0,0,0>
> 2 , <2,2,2>
>
> }
>
> isosurface {
> function{
> MySpline(1).x
> }
> contained_by { box { -2, 2 } }
> }
> -------------------
>
> Error
>
> Parse Error: Expected 'operand', spline identifier found instead
>
> How to attach a spline?
>
>
you have not properly defined MySpline as a function ....
http://wiki.povray.org/content/Reference:Function#Functions_and_Macros
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 07/08/2014 11:00 AM, Thorsten Froehlich wrote:
> "deep125" <dee### [at] yandexru> wrote:
>>> Splines have a function-like interface, so IIRC they are fully supported
>>> in functions.
>>
>> Code:
>> ----------
>>
>> #declare MySpline=spline
>> {
>> linear_spline
>> 1 , <0,0,0>
>> 2 , <2,2,2>
>>
>> }
>>
>> isosurface {
>> function{
>> MySpline(1).x
>> }
>> contained_by { box { -2, 2 } }
>> }
>> -------------------
>>
>> Error
>>
>> Parse Error: Expected 'operand', spline identifier found instead
>>
>> How to attach a spline?
>
> How about reading the documentation?
>
> http://www.povray.org/documentation/view/3.6.1/231/
>
>
>
>
how about pointing user at proper version ...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 07/08/2014 10:50 AM, deep125 wrote:
>
> How to attach a spline?
>
In this very povray.bugreports newsgroup look for the subject "Probable
thread safety issue in functions using splines. 3.7.0.RC7", from about a
year back, for a complete example using a spline in an isosurface.
In your isosurface definition it also looks as if you plan to pass a
fixed value to your spline function which would cause it to return a
fixed value to the isosurface. This will leave you with no shape at all
or a shape defined by the container shape depending upon the returned
value and the threshold used in your isosurface. In other words, it is
probably not what you want.
In addition to the built in documentation, I've found Mike William's
tutorial at : http://www.econym.demon.co.uk/isotut/index.htm helpful.
Bill P.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |