Skip to content
This repository was archived by the owner on Sep 27, 2023. It is now read-only.
This repository was archived by the owner on Sep 27, 2023. It is now read-only.

(int_)Slider comparison -> not a boolean? #110

Description

@TyberiusPrime

Describe the bug
I'm trying to write a 'sector' (circle cut out function).
For testing I wanted to stick a slider on it to choose the angle.
The function needs a couple of comparisons on the angle.
This fails with ERROR: ((*0.017453292519943295)<=3.141592653589793) is not a boolean
Leaving out the parametric slider, it works as expected

Curv Program

parametric
	set_angle:: int_slider[0,360] = 35;
in
let 
	angle = set_angle * deg;
	r = 3;
	color x = colour x
in 
intersection [
	circle r,
	union [
	polygon[
		[0,0], 
		[0,if (angle <= 180 * deg) r*2 else r*-2], 
		[r * sin angle,r * cos angle]
	] >> colour red,
	if (angle >= 90*deg) (square r >> translate[r/2,r/2] >> color blue),
	if (angle >= 180*deg) (square r >> translate[r/2,-r/2] >> color blue),
	if (angle >= 270*deg) (square r >> translate[-r/2,-r/2] >> color blue),
	],
] >> show_axes

It might just be me misunderstanding something about the language,
though.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions