<DEac->
I tried bezier-curves with bosl2. works like expected. than i tried bezier-patches. the very confusing difference is, for curves, i define points, were the curve should go through, while for patches, it is not possible to define such points. it only stretches in the given direction, but never reaches.
<DEac->
so i tried to combine both. i defined a bezier-curve and used the path as input for the patch. this ends in a mess and i do not think, that this is the desired way.
<DEac->
so, I could try closepoints. I used the bezier-curve with Z=0 and Z=20 and I got a surface, but with some issues. (I am preparing a demo)
<InPhase>
DEac-: The last two sentences of the comment of the ClosePoints module explain the issue.
<InPhase>
DEac-: The module has to guess how to close the tops and bottoms up, and uses a convexity assumption that doesn't work for your point distribution. You'd need to migrate the top and bottom closure points over closer toward y=0
<InPhase>
DEac-: Manually selecting them, it works out okay for: ClosePoints([Q1,Q2], close_top_pt=[30,2,100], close_bot_pt=[30,2,0]);
<InPhase>
You might potentially want an algorithmic manner of choosing those from your parameters.
<InPhase>
DEac-: To understand what's happening, it's forming pizza-wedge like triangles from every pair of triangles in the top surface to some chosen closure point.
<InPhase>
And its best initial guess for this is the average of the points in the top and bottom surface.
<InPhase>
J24k67: Seems to be the same person who was on reddit talking about this workflow. And he seems to be having some excellent successes with it. Clearly this is a resourceful individual.
<InPhase>
J24k67: I'm extra impressed on the side that he's including photos of his work, presumably using the same workflow of feeding the photos into ChatGPT to have it describe what is in the photos as a validation of them.
<J24k67>
sometimes a difference of two objects (closepoints) can generate the tube without going through that faces/polyhedron stuff
<J24k67>
InPhase - yes that is the guy .. i mean the model is somehow floating with parts around .. but this is cool
<InPhase>
The mountain one is fascinating, because it doesn't "look" like a mountain, but it "feels" like a mountain when you look at it. It captures a different sensory perspective where certain spatial features are enhanced.
<J24k67>
And sure we may be able to -know- (guess) how something look by seeing the code, but without seeing .. i mean sure blind people also have this spatial perception but it must be so much more difficult .. like Beethoven making music after hearing loss
<InPhase>
That aspect alone makes the mountain one a valuable work of art, I think.
<InPhase>
It has sort of captured the tactile experience of being on a mountain as a structural representation in a way that works better than a real picture of a mountain, because it sort of transforms the personal scale to the larger scale.
<J24k67>
looks like a volcanic mountain
<J24k67>
But absolutely the glimpse into his qualia of perception is stunning
malespiaut has joined #openscad
<malespiaut>
Hello everyone.
<teepee>
hi
<malespiaut>
I'm new to CAD software. I've dabbled around in FreeCAD with some tutorials, and got very frustrated with the user experience. I'm looking for a software to modelize my house, in order to view it in 3D, and possibly even produce floor plans. I'm an experienced C and Python programmer, and OpenSCAD looks like a tempting solution. Is it the right
<malespiaut>
software for what I want to achieve?
<teepee>
depends on the details I suppose, it's certainly not specialized for that kind of task, but people have used it for this
<malespiaut>
Alright. For now, as a beginner, I'm only looking for setting up walls, floors, stairs, and roof.
teepee_ has joined #openscad
teepee has quit [Ping timeout: 260 seconds]
teepee_ is now known as teepee
<InPhase>
malespiaut: Yeah, I've seen a lot of room, house, and apartment layouts done in OpenSCAD.
<InPhase>
malespiaut: And then there is JordanBrown, who has used it to model his house down to excruciating detail. ;)
<InPhase>
malespiaut: ^ The best link to start with.
<InPhase>
A quick run through that will get the syntax and starting mindset in your head rapidly.
<malespiaut>
Thank you all for that detail.
<InPhase>
malespiaut: An adaptation for your experience, is that OpenSCAD is a declarative functional language, meaning variables are single-valued in a scope, rather than imperatively updated, and thus certain calculations are done with recursive functions using tail recursion, if those calculations cannot be done directly or with list comprehensions.
<malespiaut>
Unfortunately, I think that my mind will be set rapidly, because I use Linux, and there's not a ton of FLOSS CAD software. I've learned about OpenSCAD recently “by accident” I should say. I think that I stumbled upon a YouTube video or something while looking for info about FreeCAD and one of its recent commercial fork.
<InPhase>
malespiaut: Are you a vim user?
<malespiaut>
I am.
* InPhase
grabs the link.
<malespiaut>
Although I've forced myself to like emacs for years but couldn't.
<malespiaut>
I'm going to read that wikibook link right away. My hopes for a CAD software that you program is that I'll feel much more in control, rather than having to click on 999 different buttons that are not intuitive.
<InPhase>
So I don't have to dig out the links. ;)
malespiaut has quit [Quit: Client closed]
malespiaut has joined #openscad
<malespiaut>
Sorry, I had a browser problem.
<InPhase>
I guess I should grab a new copy of that vim syntax file. Looks like mine is out of date, and the author is actually updating it with the latest features, despite not changing the "Last Changed" date.
<malespiaut>
I'll probably translate it to Lua if I end up using OpenSCAD. I'm using NeoVim, not Vim.
<malespiaut>
Alright, let's go. I'm reading and trying that tutorial.
<InPhase>
ah. Perhaps share that back then. That sounds useful. :)
<InPhase>
I have yet to convert to neovim just because of old muscle memories, but neovim does objectively appear superior.
<malespiaut>
Of course, I won't keep it for my eyes only.
snaked has quit [Quit: Leaving]
<DEac->
InPhase: InPhase: figurred out, closepoints only connects the coresponding points, but does not interpolate a curve. So, it does not seam to be better than for(p=[0:L])hull(){r(paths[p]);r(paths[p+1]);}
<J24k67>
malespiaut if you start with a SVG of your floor plan .. extrude that it is not so much work
<malespiaut>
Alright J24k67. But I have nothing. I'm completely starting from scratch, with my ruler and my computer.
<J24k67>
oh .. floorplans do exist for every building
<J24k67>
but then maybe start making a module for a room so you can use this. All rooms are 90° corner in your house?
<malespiaut>
I'm pretty sure that there are none for my old house, which went under severa modifications.
<InPhase>
DEac-: It's substantially better than the hull approach in terms of runtime and facet efficiency, and it also avoids the fatal flaw of using hull which causes hull to fail for concave surfaces. But in the convex-only case it is approximately equivalent to doing that.
<J24k67>
then maybe make a polygon of the outer size of your house .. and remove each room as polygon from it
<InPhase>
DEac-: And if you desire some sort of interpolation, you have to choose which interpolation, and perform that. I demonstrated one approach to such an interpolation with my bezier / closepoints example above that I was calling a faucet. The demos on the closepoints repository show some other ways to approach generating intermediate values.
<J24k67>
malespiaut the question is how well can you measure the room and angles
<InPhase>
DEac-: And really this is sort of what you need most of the time. There are an infinite number of possible or reasonable interpolations between point outlines, and any sort of automatic curved interpolation will almost always be wrong.
<malespiaut>
J24k67: 🤷🏻♂️, no idea, but I'll just do it anyway.
<InPhase>
DEac-: I rarely need the same solution twice. :)
malespiaut has quit [Quit: Client closed]
J24k67 has quit [Quit: Client closed]
J24k67 has joined #openscad
<DEac->
InPhase: but, the only way, seams to be, to do it manually (for-loop). the bezier-curve must have anytime equidistant
<DEac->
so, if there are more details in the curve at the beginning, later lesser and i want to combine it with another curve, it has to have first more detailed points (also if it is a line), like the first.
<DEac->
the "rendered" bezier-curve has to have these details, not the points for the bezier-curve
malespiaut has joined #openscad
<malespiaut>
The Wikibook tutorial is very well done.
<malespiaut>
Quite easy to get the general idea.
<malespiaut>
I think that it'll be OK for a basic floor plan. I must admit that the synthax of OpenSCAD programming language isn't the clearest; it makes me wish that the language was more a dialect of LISP instead. :-P And some concepts looks like a workaround. But it's far easier than banging my head on the keyboard to understand FreeCAD convoluted user
<malespiaut>
experience.
little_blossom has quit [Quit: little_blossom]
little_blossom has joined #openscad
<InPhase>
DEac-: Yeah, but that's what I did in the example.
<InPhase>
DEac-: Are you familiar with "zip" from Python? That was the magic-looking transformation that made that straightforward to do.
<DEac->
InPhase: your example is easier. I have a surface, which is in the 1/3 on the left curvy, on the right flat.
<DEac->
InPhase: I would never touch python. but if you mean the functional zip-function, yes, of course.
<InPhase>
DEac-: It took an array of polygon definitions and converted it into an array of matched control points from those polygons, then applied Bezier curves to each, then transformed them back into an array of surface outline loops.
<DEac->
InPhase: your bezier-function seams to work different. the bosl2 produces only needed points.
<InPhase>
I'm not familiar with that one, but I designed mine to produce the number of points specified in an interpolation.
<InPhase>
That to me seems to be the standard usage.
<InPhase>
I'm aware of course that there is a bosl2 one, but bezier is simple enough that I never went hunting in bosl2 for it.
<DEac->
InPhase: so, you make this? paths=[bezier(...),...]; Xs = [for(ps=paths)for(p=ps)p.x]; [[for(x=sort(Xs)) bezier(..., at x)]]
<InPhase>
I'm not sure what you mean by that. It seems to be some very manual manipulation of coordinates.
<InPhase>
I try to work with list structures.
<DEac->
i mean, first determine usefull points on X-axis for any curve. then calculate the y on the curve for any determined x.
Guest3630 is now known as buZz
<InPhase>
DEac-: Well it depends on what you're doing. I have done this sort of thing before while trying to do irregular fill patterns, like trying to bezier fill a corner between 3 right angle axes.
<InPhase>
DEac-: I worked on a solution like that with guso78 recently.
<InPhase>
That had to be iterated out with extra logic because it was necessary to fill the tesselation fairly evenly with a steadily decreasing number of interpolated points from layer to layer.
<DEac->
my surface should be differently curved in two directions and both sides are different. there are functions for the x-direction, but not for the y-direction. in one x-slice there are many points, in others only less. I do not see any soltion with closepoints
<DEac->
partialy, i could define surfaces easy, but i cannot connect them.
<DEac->
nurbs would be the finest solution. bezier-surfaces, but with defined points on the surface would be ok, too.
<buZz>
J24k67: you ment making a Cube module to use instead of the internal cube?
<InPhase>
DEac-: closepoints is definitionally established as matched numbers of points, although usually I just solve it by filling in the same number of points all along. This works for most cases except where one end comes to a point.
malespiaut has quit [Quit: Client closed]
<InPhase>
DEac-: This is not my idea of a beginner-friendly approach, but this is the example code of where I worked with irregular point counts per layer: https://bpa.st/UCPQ
<InPhase>
DEac-: You'll see it comes out nice, but the reasoning gets a little tricky when you have to manually figure out the facets like that for polyhedron. The whole point of the design of closepoints was to work for most cases while shielding people from thinking about this sort of thing. :)
<InPhase>
I haven't written a general-purpose equivalent with variable point counts between layers for the simple reason that I don't know how to do that "in general". There are too many variations of what people would mean when they are varying point counts, and it is almost impossible to guess reasonably in a standardized manner about how to interpret the intended mappings between the points.
<InPhase>
But I know how to do it for specific cases, like this example.
<InPhase>
With fixed point counts between layers, the definition is simple and clear.
yogadude has joined #openscad
kdc has joined #openscad
<J24k67>
Makerworld now has AI generated 3D models from images (sorry off topic not openscad related)
<J24k67>
buZz yeah a wrapper so you can introduce the variable
<buZz>
that could work but prevents autocomplete to work, i think
* buZz
trying openscad on a Vaio VGN-P70H
<J24k67>
yes because autocomplete doesn't scan libraries .. on the playground the editor does .. also the new arduino IDE is showing the doxygen info aswell
<buZz>
cute
<buZz>
i'm getting into a flow where i want to spend a fixed time like 10-15 minutes to 'do a design' between waking up and getting my first coffee
<buZz>
leveraging autocomplete and shortcuts would be wise to increase speed :P
<kintel>
Context: I want to automatically test all examples in both experimental (Manifold) and release (CGAL) mode
<InPhase>
Hmm.
<InPhase>
kintel: So line 28 of image_compare.py has d[np.abs(d)<3] = 0
<InPhase>
kintel: I think the most appropriate adjustment for alpha cases is to make 3 a little bigger.
<InPhase>
That was a totally arbitrary number, and I don't think real issues are usually very close to that threshold.
<InPhase>
kintel: Units at that spot are 0-255
<InPhase>
kintel: I would suggest raise 3 until your test passes, then maybe add 1 more for good measure. ;)
<InPhase>
If you have to make 3 very large, then I've misunderstood something.
<InPhase>
Probably somewhere from 4-10 makes it pass just fine.
fling has quit [Remote host closed the connection]
<InPhase>
Most of what we're testing for are structural differences, which should have a different scale of color difference from these alpha cases. The most subtle structural issues will be like the color gradient differences between shading elements of the number of segments around a cylinder differed, but even if we take this same faded alpha case and look at those values, I'm seeing contrasts of 10-20 and
fling has joined #openscad
<InPhase>
some are higher, and I think this is the extreme case for it.
<InPhase>
So values of somewhere between 4-10 should still pick up every difference we're interested in, but filter away these faint alpha coloring shifts.
<InPhase>
kintel: So, somewhere in that range I think.
<kintel>
InPhase Thx, I'll play around with that for a bit!
<InPhase>
*thumbs-up*
<kintel>
Had to raise it to 6 to make it work locally.
fling has quit [Remote host closed the connection]
teepee has quit [Remote host closed the connection]
fling has joined #openscad
teepee has joined #openscad
mohammad1722 has joined #openscad
mohammad1722 has quit [Ping timeout: 250 seconds]
mohammad1722 has joined #openscad
<mohammad1722>
Hey teepee and kintel, I'd like to suggest that we schedule weekly meetings to discuss my GSoC project progress. This would help break down the work and ensure I'm on the right track with your regular feedback. Let me know what you both think and what time works best. Thanks!
<kintel>
I might not be in a great timezone for real-time meetings, but if we could maintain a google doc or smth. with notes, that would be a great opportunity to allow for asynchronous input. Such a doc is also great for logging daily/weekly activities and priorities
<mohammad1722>
teepee For me, Friday and Saturday are all free. I'm leaning more towards Friday morning/afternoon maybe. But both days are ok with me.
<mohammad1722>
kintel A google doc is certainly great too
mmu_man has joined #openscad
<teepee>
days are fine, due to work it would be only evening UTC for me, kintel likely prefers as late as possible as he's in a timezone a couple of hours later
<kintel>
Saturdays are hard. Weekday mornings for me are doable, but my schedule is all over the place. I'm also away for most of July and half of August, so it might be easier to not try to slot me in, and I can join on an opportunistic basis, or we can schedule something if my real-time input is really needed
sadome has joined #openscad
sadome has joined #openscad
sadome has quit [Excess Flood]
mohammad1722 has quit [Ping timeout: 250 seconds]
mohammad1722 has joined #openscad
<DEac->
InPhase: ofcourse, i totaly understand, that you need constant point counts. My problem is, that i try to get good points, but fail. I cannot define some points, which a library simply use and if i use a bezier-curve, these are not equidistant. I know it from nurbs, where you can define the nurbs-curve, than you define connection-points on the curves, that these will be connected to build a surface.
<DEac->
i'm already impressed, that bezier-curves and -surfaces exist. but second does not work like i want to have. closepoints are not a solution to define the surface, only to build it.
<InPhase>
DEac-: Oh, you mean your problem is unequal point density along the path of the curve?
<DEac->
i think about a mix - bezier-curves, defining points on the curve as connection-points and try to define an additional bezier-curve on these points.
<DEac->
InPhase: yes.
kintel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<InPhase>
DEac-: I think it would be possible to implement an algorithm that dynamically adjusts the Bezier point spacings based on the resulting coordinate spacings. I'm at work, and would have to think about it, but that sounds like something definitely doable. If you want to try to play around with it, the thing jostling around in my head is that you could generate a trial set of points, measure the point to
<InPhase>
point spacings, find the cumulative sum array of those, and normalize those cumulative sums so that they end in 1. Then generate a second set of bezier curve points using those t values instead of equally spaced t values.
<DEac->
InPhase:
<InPhase>
There would be a slight additional step in there to get the calculation right. I think if you do exactly what I said, it makes them tighter, but you might need to invert the values first, or something similar.
<DEac->
InPhase: bosl2 allowes to calculate the closest point on the curve. so i could calculate the points for [0:1:L]. not tried yet. of course i could get the bezier-curves of any of my curves, than use this list as input of the calculation of the closest points.
mohammad1722 has quit [Ping timeout: 250 seconds]
Scopeuk has quit [Quit: Quit]
Scopeuk has joined #openscad
<InPhase>
DEac-: You could also patch up your problem with a cheap hack that gets you close, and call it a day. ;) https://bpa.st/PE2A
dTal_ is now known as dTal
<DEac->
InPhase: hmm, that's too easy. i do not know, why it works. each i didn't know, yet, but now i understand it. interp() sounds interesting. really cheap.
<InPhase>
If you want to solve the general problem, this is a stupid approach. If you want to solve one problem, cheap is great. ;)
<InPhase>
The 3*N was because your chosen bosl function was yelling at me on the point counts.
<InPhase>
Fortunately 3*N for N=1 got close to a matched point density on that exact scenario.
Reisga2 has quit [Quit: Ping timeout (120 seconds)]