farrellm / scad-clj Goto Github PK
View Code? Open in Web Editor NEWOpenSCAD DSL in Clojure
License: Eclipse Public License 1.0
OpenSCAD DSL in Clojure
License: Eclipse Public License 1.0
Most of the fonts on my system render properly, but the holes in the glyphs in Copperplate don't show up. Need to dig into the segments to see why the interior paths aren't being detected.
Considering ImplicitCAD is made to be semi-interoperable with OpenSCAD's syntax, I was wondering if this software package could add ImplicitCAD support, or if an ImplicitCAD port could be forked from this.
The extrude-rotate
method does not seem to support the with-fn
macro.
This should accept a $fn
argument to indicate how many subdivisions for an extrusion.
I am a bit of a beginner still in Clojure so it might be just that, but I just can't figure out how to use the f*! functions to actually set the variable at the root so it's effective globally. I have only managed to insert them with some function that accepts unlimited blocks like render or union. This can provide the same effect, but I can't help but think that I should be able to insert it in the root at the beginning of the file.
I use many different scad libraries, it would nice to have that ability from clojure.
It would be great if scad-clj could support the new(ish) OpenSCAD text() function directly. Currently it looks like scad-clj is doing some magic to generate text as polygons, but it would be much simpler/nicer if the native text() function could be used: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_the_2D_Subsystem#Text
Over in scad-app
Iโve run into the problem of how to recognize the intermediate products of scad-clj
by their type. Iโm currently using seq?
. I would like to expand on this. For example, I would like to create Clojure functions that work interchangeably with shapes like (cube 1 2 3)
and raw Cartesian coordinates like [0 0]
, adding translations/transformations to the former while directly replacing the latter using this stuff behind a (spec/conform ...)
. In general, I would like to be able to use spec/valid?
for sanity checks and annotations in all sorts of places as I build upon scad-clj
.
Should I be using something other than seq?
as a predicate to test for intermediates? Would it be possible to guarantee a more specific spec
-able format for all intermediates, or is this considered an unstable implementation detail pending #37?
So, I noticed that support for modules was removed in 29a5988 without any explanation and was curious why that was done. Wouldn't it be useful for interop with existing utilities/packages that people are sharing?
Hey @farrellm ๐,
I recently put together a list of all of the code-CAD projects that I know of here, and also on Github. I stumbled across scad-clj today and have added it. As a brief summary I wrote:
OpenSCAD DSL in Clojure. Functions generally mirror OpenSCAD, with a couple of notable exceptions.
Though I would love some feedback from you if you want to add or change it? The context is that it's in a list with many other code-cad projects, so information about how it differentiates is most useful.
Cheers,
Kurt
Having a 0.4.2 release on clojars would be nice since it has the new text() feature and a few other fixes. Any chance you might push that out any time soon?
Sorry to post it here, but have tried to find the documentation and there is not one.
I'm getting an error trying to use multmatrix, I created a method which give me that output:
user=> (load-file "src/my-project/test.clj")
[[0.7071067811865475 0.0 0.7071067811865476 0.0] [0.0 -0.7071067811865475 0.0 0.0] [-0.7071067811865476 0.0 0.7071067811865475 0.0] [0.0 0.0 0.0 1.0]]
But when a try to call multmatrix
I got that error:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: multmatrix in this context, compiling:(path to my clj file)
Everything else seems to work, 2-d and 3d objects, others transformations and so on, but I can't call that method. How can do I invoke it?
I am seeing a NoClassDefFoundError when I try to run the example in scad-clj.designs.text. The class is getting compiled, but class.forName is failing. Did you see this? I successfully installed OpenCV for osx, and installed its jar into maven.
If I do a linear extrude on a model with a scale property as follows
extrude-linear {:height body-height :scale [1 0.1] :center false}
what outputs is the following in openscad
linear_extrude (height=62.02, scale=[1 0.1])
this is a syntax error.
I think when write-expression encounters clojure arrays it should comma separate them to be save.
Unless I am misunderstanding how they are meant to be used, it seems like none of the with-f* functions work correctly. If I try using, e.g. (with-fs 0.1 ...), I get the error 'Unable to resolve fs in this context', presumably because the symbol is not namespace qualified in the definition of with-fs. But if I try doing (with-f* 'scad-clj.model/fs 0.1 ...), I get the error 'nth not supported on this type: Symbol' from line 9 of scad-clj.scad, which is the multimethod definition of write-expr.
I added a comment in the code for the change in PR #16 where I believe the problem lies.
If center-default is true (which is the default), there is no way to selectively set center=false for an individual shape. E.g. the following:
(cube 100 50 10 :center false)
will still generate scad with center=true:
cube ([100, 50, 10], center=true);
This is because the various write-expr methods in scad-cli.scad treat the center parameter like this:
(when center ", center=true")
That is, they only do something when the center parameter is true. If the center param is false, nothing happens and the default behavior prevails, which is to set center to true.
example:
(apply union
(with-fn 1
(map (fn [i] (translate [(* i 4) 0 0] (sphere 8)))
(range 8))))
Hi there, I'm a clojure and leinigen noob working on a Dactyl keyboard and I need to shear a cylinder with multmatrix, but the latest release 0.5.3 pre-dates commit baa0738
Can you please tag and release a new version so I can stick that into my project.clj?
Thanks a lot!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.