On Mon, Mar 16, 2015 at 6:25 PM, Ilinca Andrei
<andrei.ilinc...@gmail.com> wrote:
> Hello!
>
> As we discussed, I have submitted a patch adding a very simple OpenSCAD
> importer, any feedback is appreciated!

Looks good at a quick glance - I'll try to take a closer look in the
next day or two.

> At this moment, my understanding is that OpenSCAD uses text format, which I
> have to parse, build logic from, then save the logic in a .g geometry
> database.

Correct.  It's actually more complex than that - OpenSCAD uses an
actual programming language to define geometry, so successfully
interpreting those files will involve implementing enough of the
language features to make sense of the files.  OpenSCAD guys, any
advice on the best way to go at that?

> My priority is to fix any issues at that initial, very simple
> patch, so if you have any suggestions, please let me know.

I'll try to look it over in a bit more detail.  Now that you can
access the file, you might want to consider thinking about how to
"digest" the language a bit.  We have a number of places that use the
tools perplex/re2c and lemon in the code base for that sort of work -
I'm not 100 percent sure if they're a good match for this, but you
might want to look them over.  The obj and step importers are complex
uses of those tools.  There's one that's a bit simpler in the
misc/dom2dox directory, which is intended to translate the openNURBS
documentation into doxygen, that might be a bit easier to look at
initially.  You might consider trying to "tokenize" the file with a
perplex scanner to see how that works...

You don't have to use those tools, but in some situations they can
make things easier - you end up describing the tokens and grammar of
the language in a bit more of an abstract form, rather than hand
coding parsing code.  That said, if it is more complexity than it's
worth you don't want to get bogged down - try to get a sense of what
you think would work best.

> After that, I will start working on my proposal the same time as I further
> extend the OpenSCAD logic/parser. I was thinking that the next step would be
> to correctly identify the modules in OpenSCAD structure and store them in a
> data structure(possibly a vector, initially?).
>
> How does that sound?

Sounds good.  Make sure you try to get a sense of the scope and
approach you'll need to take - you want to have a proposal that
demonstrates a firm grasp of what you're trying to achieve and how to
achieve it.  The more detailed the better.

Cheers,
CY

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to