Hi Jon,
Thanks, I appreciate your comments. I've replied below.
Best wishes,
Ray
On 14/05/2026 13:50, Jon Bondy wrote:
Ray:
What an interesting effort! I wish you luck. What are you trying to
achieve, with your new CAD software, that is not available, or
convenient, in other contexts?
I like the parametric design concept in openscad, but not the sort of
functional language structure. I do not like the Python syntax, either,
since using spaces or tabs as part of the code, to me, is a bit daft.
Floating point numbers give problems in cad, or anywhere that precision
is needed, so I started looking at the Manifold library. Using AI, I was
able to write a couple of cad test programs in Python, relatively
quickly, since there is a lot of Python code for it to find. However, I
also discovered, when I was using it last year, that Manifold did not
handle booleans in Python. So, I decided to test out AI in writing cpp.
It has been a mixture of fun, and hours of frustration, but it is
getting better. It has got me thinking fundamentally about various
aspects of the 3d world, and modelling thereof.
For important calculations, i.e. money, then fp numbers are not used,
Integers or fixed dp are used. This is what manifold uses. It is default
limited to 6dp, but that can be changed. This means that there is no
ambiguity that is visible in openscad fast render/etc. But it brings in
a load of other problems, e.g. .net, ensuring the shape calculations
are all manifold. Also, in my real world, 2d shapes do not exist, so
that removes a lot of conflicts, which is shown by the way in which
colour is handled, for example. Also, I can selectively chamfer edges,
since my viewer allows me to select vertices visually with the mouse.
So, In effect I can create, with AI exactly the results I want, since I
do not write cpp, but eventually I will, I guess. I wrote a load of
graphic software about ten years ago, using c#, but that used but now i
do not want .net, so I decided on cpp. As it is, I can create in my
cad, virtually anything I want, and if not, then I can get AI to write
the cpp function and include that. There are a few downsides, however,
but nonetheless, I now use it to design objects in preference to using
any other software.
1.8 GB of code sounds at least 3 orders of magnitude larger than
necessary. I found this figure to be astonishingly large.
It is large, but that is the development file, all the raw cpp, test cad
files, etc. The .exe is about 18KB, plus a few dlls. However, the
problem with the AI that I have used, is that it wants to patch, instead
of using existing functions, even functions it created ten minutes
earlier. It all needs a good going-through to refactor, but I think
there may be one or two other functions to be developed
What is the "x/y problem" please?
:)
Once you've seen this, you will see it everywhere! Best not to answer
forum posts by replying 'x/y' ...
A good explanation and examples at
https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem
Jon
On 5/14/2026 8:18 AM, Raymond West via Discuss wrote:
HI,
Last November, I started developing my own cad program, written in
cpp, using AI (co-pilot in visual studio code). It has now got to the
stage that I can not remember all the function details, and I have
used copilot to generate an html helper sheet. It also has a short
list of pseudonyms, since if you don't know the exact word, you will
not normally find its functionality. So, for example, if you want to
'add' a couple of shapes, and do not know that it is a boolean union
operation, then a search on 'add' will bring up the union operation
description. If more detail is required, then in the program editor I
can enter '? union full', to get a full description and example of
'union'. If, in the editor, I enter '?', then on the console I get a
full list of functions, or I can select select just the parameters,
examples or the algorithm.Furthermore, there is a verbose flag that can be set in the code,
that gives the details of each calculation within any selected
function, as the program runs, which is useful for debugging.I can also ask copilot to generate code in my cad language. I've not
tested if it can translate openscad to my cad, or vice versa. One
problem is, not to fall into the x/y problem situation, which I often
do, and continuously see on fora/elsewhere.I think, since I make many typos, that I may need it to create a
pre-parser, but already it is 1.8 GB of code, which needs
considerable re-factoring.I've attached the html helper below, if anybody wants to play with it.
Best wishers,
Ray
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
On 5/14/26 11:21 AM, Raymond West via Discuss wrote:
Integers or fixed dp are used. This is what manifold uses
https://github.com/elalish/manifold/blob/73c687839a8d3b2c53f48309eaf28f31289ebf97/src/impl.h#L56
What leads you to believe Manifold is using fixed point?
On 5/14/2026 11:21 AM, Raymond West via Discuss wrote:
For important calculations, i.e. money, then fp numbers are not used,
Integers or fixed dp are used.
Decimal is no better. People think it's better because its failings are
more natural to them.
I just filled out a beneficiary form for my three children. It wanted
to know what percentage to apply to each of them.
One third cannot be represented precisely in decimal; the only option
was to list them as 33.3%, 33.3%, and 33.4%.
Similarly, integers "feel" better because their failings are more
"natural". Indeed, it's poor when you add 0.1 ten times and you end up
with 0.9999, but it's also pretty bad when you add 1/10 ten times and
end up with zero.
Hi Cory,
sorry for the sloppy statement wrt manifold and fixed dp,
The more precise answer is, (from the manifold header) manifold
calculates in either single or double precision internally. I use the 64
bit library.
from an ai enquiry on my code.
I think what I remember was something from the python versions from
earlier, where there was probably a default setting somewhere for 6dp,
maybe in trimesh or numpy. No idea, been asleep since then.
Best wishes,
Ray
On 14/05/2026 20:42, Cory Cross via Discuss wrote:
On 5/14/26 11:21 AM, Raymond West via Discuss wrote:
Integers or fixed dp are used. This is what manifold uses
https://github.com/elalish/manifold/blob/73c687839a8d3b2c53f48309eaf28f31289ebf97/src/impl.h#L56
What leads you to believe Manifold is using fixed point?
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org