TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: DSLCad – a programming language and interpreter for building 3D models

198 点作者 dschroer超过 2 年前
Hey HN. Over the last half a year I have been working on a 3D CAD programming language called DSLCAD. Today I am here to show my first release!<p>It is heavily inspired by OpenSCAD which got me hooked on the idea of a CAD programming language and what it can do.<p>Please let me know what you think. Ill be in the thread to answer any questions you may have.

25 条评论

mk_stjames超过 2 年前
I wish there was a way to combine the power of an imperative language driven model generating language like this (that generates breps, NOT meshes like openscad) but with the initial modeling using a GUI like a standard CAD tool. The reason being, it is much, much faster to draw complex parts using traditional methods versus trying to &#x27;program&#x27; them. Writing code is fine for basic shapes, but go and try an &#x27;code&#x27; a complex ribbed casting with bezier-definied swept surfaces.<p>I&#x27;d love to see a way to generate models with normal tools but, in the background, be able to access a code file that could then be embedded in an external script, headlessly. This way, say I have a part where 3 parameters change- I could take the code for that part, nest it in 3 for-loops, and iterate thru all the combinations of dimensions, procedurally generating the models (and potentially exporting them to a permanent format). FreeCAD allows actions to be scripted with Python but again, the actions have to be done in the language first- there is no &#x27;going backward&#x27; from a part done in the GUI to Python (from what I can tell).<p>This is what parmetric programs like NX, Catia, Solidworks have the ability to do via &quot;design tables&quot; or other internal tools. But even those tools don&#x27;t have an easily portable &#x27;language&#x27; that the models are portable in, and the kernels aren&#x27;t something that you can get in and poke around with (or interface with, say, Python, which is my dream).<p>Just food for thought for the author of this.
评论 #34744659 未加载
评论 #34750151 未加载
gfodor超过 2 年前
If you like the idea of a &quot;markdown for 3D models&quot;, you should definitely check out Smooth Voxels: <a href="https:&#x2F;&#x2F;svox.glitch.me&#x2F;" rel="nofollow">https:&#x2F;&#x2F;svox.glitch.me&#x2F;</a><p>I have a fork of it that is faster and also command line tools to make working with these kinds of objects UNIXy. <a href="https:&#x2F;&#x2F;github.com&#x2F;webspace-sdk&#x2F;smoothvoxels">https:&#x2F;&#x2F;github.com&#x2F;webspace-sdk&#x2F;smoothvoxels</a>
评论 #34749140 未加载
h2odragon超过 2 年前
I think your front page needs a lot more &quot;what it does&quot; and &quot;what it doesn&#x27;t (yet)&quot;. above that it needs a &quot;why this is not SCAD.&quot;<p>I suspect most people bouncing off openSCAD are upset by the &quot;programming&quot; language, so I hope yours is simpler and has less &quot;functional&quot; annoyances.<p>Having the first part of your landing page explain how your project doesn&#x27;t require forcing one&#x27;s mind through the eye of those needles like SCAD does would be a great step to get people interested in trying to do things with it.
评论 #34741524 未加载
评论 #34740579 未加载
roel_v超过 2 年前
This looks awesome. If the &#x27;fillet&#x27; works, that&#x27;d be enough for me to switch from OpenSCAD. Although to be honest, having a utility library like BOSL would be necessary too, or at least some way to make threads.<p>I&#x27;m going to download but another thing I would need to switch away from OpenSCAD - the ability to use an external editor, where the 3d model reloads correctly every time I save the program. Maybe your already has it, I&#x27;m going to check it out :)
评论 #34740963 未加载
评论 #34740722 未加载
levpopov超过 2 年前
Very cool, and excited to see more &quot;Geometry as Code&quot; tools getting built. In addition to comparing to OpenSCAD it&#x27;d also be awesome to see a comparison to CadQuery.
nicoty超过 2 年前
Oh interesting. I&#x27;ve recently tried learning JSCAD as I&#x27;m trying to model my freeline skates [(current progress here)](<a href="https:&#x2F;&#x2F;gist.github.com&#x2F;nothingnesses&#x2F;dc1171c2e20f7a6d9a1cb97654497c55" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;nothingnesses&#x2F;dc1171c2e20f7a6d9a1cb9...</a>). I like it as I&#x27;m already familiar with JS (one reason I opted for it instead of OpenSCAD) and I don&#x27;t have to compile&#x2F;install anything but my browser. However, I&#x27;m running into a limitation with it as it doesn&#x27;t have a native function that allows me to bend models, so I&#x27;m currently trying to write one.<p>Is it possible to bend models easily in DSLCAD? What would you say are some reasons why someone might use DSLCAD instead of JSCAD?
评论 #34741775 未加载
mvnuweucxqokii超过 2 年前
Years ago I came across this talk about a guy who built a Clojure wrapper around OpenSCAD in order to design his own keyboard. Potentially relevant:<p><a href="https:&#x2F;&#x2F;youtu.be&#x2F;uk3A41U0iO4" rel="nofollow">https:&#x2F;&#x2F;youtu.be&#x2F;uk3A41U0iO4</a>
评论 #34743343 未加载
dTal超过 2 年前
This is great, we need more of this sort of thing. Huge kudos for making it and documenting it. I will definitely be taking it for a spin.<p>1) Do you plan to add &#x27;loft&#x27;? Without it, or some other type of morphing extrude, one is severely limited in the types of shapes it is possible to create.<p>2) I hope you don&#x27;t mind me asking, what is the psychedelic-looking image I can see a sliver of in the screenshot? It looks like a rocking desktop background.<p>By the way, if you&#x27;re not already aware of it, you may also be interested in looking at ZenCad for inspiration. It attempts to fill a similar niche (OpenSCAD-ish modeling + OpenCascade), except it uses Python.
评论 #34746280 未加载
评论 #34746263 未加载
empressplay超过 2 年前
Great stuff! If you&#x27;re interested in something similar with a simpler language (Logo) and relative model construction (using the turtle) check out turtleSpaces: <a href="https:&#x2F;&#x2F;turtlespaces.org&#x2F;2021&#x2F;09&#x2F;08&#x2F;how-to-create-and-3d-print-a-chess-pawn-in-turtlespaces-logo&#x2F;" rel="nofollow">https:&#x2F;&#x2F;turtlespaces.org&#x2F;2021&#x2F;09&#x2F;08&#x2F;how-to-create-and-3d-pri...</a> You can export STL files and 3D print them. We&#x27;ll be adding a multi-color export method soon
mk_stjames超过 2 年前
If you haven&#x27;t seen it you may want to check out <a href="https:&#x2F;&#x2F;github.com&#x2F;zalo&#x2F;CascadeStudio">https:&#x2F;&#x2F;github.com&#x2F;zalo&#x2F;CascadeStudio</a><p>From what I see, it is exposing the OpenCascade base commands directly, versus your completely new DSL, but you might be interested in a way to implement your DSL on top of such an interface such as this which takes out a lot of the extra work of having a rendering interface, exports, etc, maybe.
loa_in_超过 2 年前
See also open source Pov-RAY. Not my software. It has full featured boolean volumes, and could be called text based Blender.<p><a href="http:&#x2F;&#x2F;www.povray.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.povray.org&#x2F;</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;cyborg5&#x2F;pov2mesh">https:&#x2F;&#x2F;github.com&#x2F;cyborg5&#x2F;pov2mesh</a>
评论 #34746042 未加载
zellyn超过 2 年前
It might be nice to be able to install it with homebrew on MacOS.<p>btw, I know it&#x27;s not open source, but you might be interested in KittyCAD: I believe they&#x27;re looking for software developers with CAD experience. And you could do worse than work with Jessie Frazelle!
评论 #34741851 未加载
digdugdirk超过 2 年前
Very cool! What modeling kernel does it use?<p>Out of curiosity - are you a mechanical engineer? I&#x27;d be curious to know what your history is with different CAD programs, and what effect that had on the design&#x2F;use decisions you made with DSLCAD.
评论 #34741545 未加载
评论 #34741147 未加载
mkeeter超过 2 年前
Can you say a little more about the geometry kernel? Is it NURBS-based, triangles, f-reps, etc?<p>IIRC, OpenSCAD uses CGAL and is all triangles under the hood; other tools use OpenCascade for NURBS modeling, or weirder DIY kernels.
评论 #34741136 未加载
WillAdams超过 2 年前
Would writing out text files be an option?<p>I&#x27;ve been trying to do this from OpenSCAD (now using RapCAD) and while I sort of have it working:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;WillAdams&#x2F;gcodepreview">https:&#x2F;&#x2F;github.com&#x2F;WillAdams&#x2F;gcodepreview</a><p>I&#x27;m not so far along that I wouldn&#x27;t try something else.
评论 #34752693 未加载
elromulous超过 2 年前
I&#x27;ll have to check this out. Really great to see more of &quot;cad as code&quot;. My current favorite is cadquery. It&#x27;s pretty neat in that it simply is python.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;CadQuery&#x2F;cadquery">https:&#x2F;&#x2F;github.com&#x2F;CadQuery&#x2F;cadquery</a>
trehans超过 2 年前
This is great! I&#x27;ve been looking for something like this for a while. My only question is: does this do constraint-based modeling like other CAD software or do you have to specify individual parameter values?
评论 #34745148 未加载
siemensikkema超过 2 年前
This reminds me of <a href="https:&#x2F;&#x2F;github.com&#x2F;nicklockwood&#x2F;ShapeScript">https:&#x2F;&#x2F;github.com&#x2F;nicklockwood&#x2F;ShapeScript</a> although that is limited to Apple platforms.
AlbertoGP超过 2 年前
The inertial model rotation is a pleasure to use, I’ve done the same in some of my programs and while it feels a bit strange at first it does make it easier for me to perceive the shape as it moves.
rcarmo超过 2 年前
Chamfer and fillet are awesome, but the pipe… mixed feelings, especially since it uses a dash. Either a normal pipe or an Ocaml-like |&gt; would feel more natural.
评论 #34747857 未加载
qualudeheart超过 2 年前
This is very cool. Do you use Github Sponsors so I can tip you?
zem超过 2 年前
quick comment - if you have to note in the readme that it&#x27;s pronounced &quot;diesel cad&quot; you should just rename it &quot;dieselcad&quot; and be done with that stumbling block.
评论 #34747518 未加载
junon超过 2 年前
Your LICENSE file is misspelled, by the way.
评论 #34750938 未加载
评论 #34741551 未加载
croes超过 2 年前
The link to the documentation page gives 404
评论 #34740763 未加载
pvillano超过 2 年前
This might be the right thread to ask for help with a 3d problem I&#x27;ve been working on for a year or so.<p>I have a resin 3D printer, and I want to make handles for it. Specifically, ultra lightweight handles using an irregular lattice.<p>OpenSCAD chokes on trying to union 100s of cylinders. Real tools cost $1,000s. Right now it looks like I&#x27;ll have to write something to do the union in voxel space
评论 #34749157 未加载
评论 #34750955 未加载
评论 #34749669 未加载
评论 #34749150 未加载