|
 |
On 2023-02-08 10:54 (-4), Chris R wrote:
> "Chris R" <car### [at] comcast net> wrote:
>> I have been experiencing crashes running the latest beta of POV-Ray v3.8 (Win64)
>> when trying to call a spline. The narrowed it down to a few lines of code that
>> causes the crash:
>>
>> [snip]
Confirmed on GNU/Linux. V3.8 beta 2 yields a seg fault. All other
versions I have beyond 3.1.0.10, including the master branch, UberPOV,
and the discontinued v3.7.1-RC1, yield "std::bad_alloc". My oldest
UberPOV is 1.37.1.0-b10.
> One last observation, the following code also seems to work fine. This leads me
> to believe the problem lies with returning the spline identifier from the macro
> and then trying to use it. It's a kludgy work-around, but I can use it to
> continue on my current project.
>
> #macro make_spline_macro()
> #declare myspline = spline {
> natural_spline
> 0, <0, 0, 0>,
> 1, <0, 0, 1>,
> 2, <1, 0, 2>,
> 3, <2, 1, 3>
> }
> #end
>
> make_spline_macro()
>
> #debug concat("_pt=<", vstr(3, myspline(0), ",", 0, 3), ">\n")
This non-kludgy workaround also works:
#macro make_spline()
spline {
quadratic_spline
0, <0, 0, 0>,
1, <0, 0, 1>,
2, <1, 0, 2>,
3, <2, 1, 3>
}
#end
#local myspline = make_spline()
#debug concat("_pt=<", vstr(3, myspline(0), ",", 0, 3), ">\n")
Post a reply to this message
|
 |