Haskell-Things / Haskell-Things/ImplicitCAD

Defining an implicit function

Open
#233 12 comments 0 reactions 1 assignee Claimed by @julialongtin View on GitHub
extopenscad feature-request In-Progress
Dominant language
JavaScript
Stars
1.6k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

I'm not sure if this is possible, but it is certainly in the spirit of ImplicitCAD, so I would like to know if anyone knows how to do it. A Haskell answer is just as good as an extopenscad answer.

Suppose I want to define a new implicit function, in this case, the astroid. It is similar to the circle, but has a different L-norm.

```
astroid(x,y) = (x**(2/3)+y**(2/3))**(3/2) -1
```

This function is negative for (x,y) in the astroid region, zero on the perimeter and positive outside. I would now like to use this function in ImplicitCAD in this manner (replacing circle(1) with the new astroid shape):

This works:
```
linear_extrude(height(x,y) = 1 + cos(x)/2 + cos(y)/2 )
circle(1);
```

I would like to make this:
```
linear_extrude(height(x,y) = 1 + cos(x)/2 + cos(y)/2 )
astroid;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.