<InPhase>
JordanBrown: Based on the insight that 999 means "next line is a comment" I wrote a bash script line that I think will extract all the layer names. grep -A1 -E '^ 8$' "$FILE" | grep -Ev '^ 8$|^--$' | sort | uniq
<InPhase>
That should save me from needing to open inkscape in the future. :)
<JordanBrown>
Maybe we will some time implement import(dxf) as a function that can then return some or all of the data from the DXF.
<InPhase>
A first run could return an object with .layers being a list of the layer names.
<JordanBrown>
Perhaps, though since you later might want to return the *contents* of those layers, it might be better if layers[] is a vector of objects, with "name" being the name of that layer.
<JordanBrown>
so that o.layers[i].somethingelse could be some other parameter of that layer.
<InPhase>
Perhaps .layer_names then.
<JordanBrown>
You're offending my sense of schema :-)
<InPhase>
:)
<JordanBrown>
I think that o.layers[i].name would be a perfectly usable start.
<JordanBrown>
Though I'd want to analyze the format to find whether there should be anything above "layers".
<JordanBrown>
(Like, maybe, if it had some kind of higher-level grouping.)
<JordanBrown>
It is tempting to implement import("foo.txt") but we are treading perilously close to letting OpenSCAD have too much access to your system.
lf94- is now known as lf94
_whitelogger has joined #openscad
guso78k has quit [Ping timeout: 272 seconds]
J25k97 has joined #openscad
J25k80 has quit [Ping timeout: 272 seconds]
_whitelogger has joined #openscad
peepsalot has quit [Quit: Connection reset by peep]
peepsalot has joined #openscad
peepsalot has quit [Quit: Connection reset by peep]
peepsalot has joined #openscad
UltimateCodeWarr has quit [Ping timeout: 272 seconds]
JakeSays has quit [Ping timeout: 260 seconds]
JakeSays has joined #openscad
RoyK has joined #openscad
bitbasher has joined #openscad
bitbasher has quit [Changing host]
bitbasher has joined #openscad
RoyK has quit [Ping timeout: 260 seconds]
<gbruno>
[github] bitbasher opened issue #6031 (import dxf fails as function with import-function enabled, while calling import() as a module works) https://github.com/openscad/openscad/issues/6031
<gbruno>
[github] kintel closed issue #6031 (import dxf fails as function with import-function enabled, while calling import() as a module works) https://github.com/openscad/openscad/issues/6031
guso78k has joined #openscad
bozo16 has quit [Quit: Leaving]
<bitbasher>
this is my comment and question on Jordan's bug about import() function
<bitbasher>
folks .. if there is a function called import() that only works on JSON files, and an import() module that uses the file's extension to know how to read the file shouldn't they have different names? either : define a function info = import_json( "filename.json" ) and rejects all other file types use existing module import( "filename.any" ) or: .. well, to me nothing else makes sense. i cannot even find the code for the function import
<bitbasher>
ah .. i may have just found the import json code in io folder .. but i dont see how it is called by info = import() yet
<guso78k>
there is an import_stl function, but it has been deprecated for a long time because openscad want to get rid of it in favor of import()
<guso78k>
but the two namespaces of openscad (functions and modules) are really confusing. Depending on the implicit context literal names have completly different functions
califax has joined #openscad
<guso78k>
and if() returns a module/node ....
<bitbasher>
yeah .. this is spaghetti code elevated to a meta level
<bitbasher>
what sort of data can be imported from a json file .. like, an array of points for a polygon or polyhedron?
howiemnt has quit [Remote host closed the connection]
howiemnt has joined #openscad
<guso78k>
i think , anyhing which can be interpreted into strings, numbers, lists and dictionaries. therefor also coordinates and polygons ,....
<guso78k>
its just about how you interprete it
mmu_man has joined #openscad
J25k97 has quit [Quit: Client closed]
J25k97 has joined #openscad
bitbasher has quit [Ping timeout: 248 seconds]
cbmuser has quit [Quit: WeeChat 3.8]
cbmuser has joined #openscad
guso78k has quit [Quit: Client closed]
J25k97 has quit [Quit: Client closed]
J25k97 has joined #openscad
mmu_man has quit [Ping timeout: 272 seconds]
bitbasher has joined #openscad
J25k97 has quit [Quit: Client closed]
J25k97 has joined #openscad
mmu_man has joined #openscad
RoyK has joined #openscad
mmu_man has quit [Ping timeout: 248 seconds]
guso78k has joined #openscad
guso78k has quit [Quit: Client closed]
Chancer has joined #openscad
Chancer has quit [Changing host]
Chancer has joined #openscad
bozo16 has joined #openscad
mmu_man has joined #openscad
sculptor has joined #openscad
sculptor has quit [Changing host]
sculptor has joined #openscad
bitbasher has quit [Ping timeout: 248 seconds]
bitbasher has joined #openscad
nomike_ has quit [Quit: Leaving]
<JordanBrown>
Yes, that's all pretty much correct. Unlike many other languages (but like some), OpenSCAD has separate namespaces for variables, functions, and modules (which some might call subroutines).
<JordanBrown>
And yes, that can be confusing for people who are used to unified-namespace languages.
<JordanBrown>
import-the-module and import-the-function are two different components, with different capabilities.
<JordanBrown>
And yes, the JSON that you import can be whatever you want it to be. That capability provides a way to have a workflow where one component generates some data, and an OpenSCAD program processes it into a 3D model.
califax has quit [Remote host closed the connection]
<JordanBrown>
There has never been an import_stl() *function*. There was an import_stl() *module*, that was deprecated and eventually removed in favor of the multi-format import() module.
califax has joined #openscad
Chancer has quit [Quit: Connection closed for inactivity]
L29Ah has quit [Read error: Connection timed out]
califax_ has joined #openscad
califax_ has quit [Remote host closed the connection]
califax has quit [Remote host closed the connection]
califax has joined #openscad
califax has quit [Remote host closed the connection]
califax has joined #openscad
califax_ has joined #openscad
califax has quit [Ping timeout: 244 seconds]
califax_ is now known as califax
teepee_ has joined #openscad
teepee has quit [Ping timeout: 244 seconds]
teepee_ is now known as teepee
bitbasher has quit [Ping timeout: 245 seconds]
hyperair has quit [Ping timeout: 248 seconds]
J25k97 has quit [Quit: Client closed]
J25k97 has joined #openscad
snaked has quit [Quit: Leaving]
RoyK has quit [Ping timeout: 248 seconds]
<gbruno>
[github] jordanbrown0 opened issue #6032 (Specifying a named argument not expected by the function/module should get a better message) https://github.com/openscad/openscad/issues/6032
RoyK has joined #openscad
bitbasher has joined #openscad
L29Ah has joined #openscad
J25k97 has quit [Quit: Client closed]
J25k97 has joined #openscad
<teepee>
bitbasher: why not just ask and discuss here?
RoyK has quit [Ping timeout: 260 seconds]
Claws61821 has joined #openscad
Claws61821 has quit [Client Quit]
RoyK has joined #openscad
<bitbasher>
for the most part i like to chat .. but when i am reporting info that may help diagnose or even solve a documented issue i update in the issue
<bitbasher>
but my testing just now shows that evn with $fn cranked way up that an .obj exported from scad is not acceptable to Slicer .. unless it is first exported as an STL and then run through the STL Repair function in Slicer .. i dont know everything the repair does, but eyeballing the contents shows triangles and not quads
<teepee>
posting on unrelated issues will potentially ping those people via email with unrelated discussions
<teepee>
but I guess I'll just mind my own stuff for a bit...
<bitbasher>
i can sympathise teepee .. i am naturally opinionated and pedantic, but many come to love me despite these flaws .. i derive joy from being helpful and comforted by a tool doing what its docs say it should be doing.
<teepee>
that part is great, but please don't invent features based on assumptions
<bitbasher>
If anyone feel i am stepping on toes i apologize .. i do try to moderate my enthusiasm .. i appreaciate and welcome feedback when i go overboard with it all
<bitbasher>
yeah .. that is hard to avoid when ignorant LOL that is why i try to test everything u can before wading in .. I know i get things wrong in places
<bitbasher>
and why am happy to receive education and feedback .. really truly
<bitbasher>
but now i need to get off to bed.. night all