-
Notifications
You must be signed in to change notification settings - Fork 56
Extendend string selector syntax using PyParsing #148
Conversation
For now the grammar is defined. It is not yet used in the StringSyntaxSelector
Two test cases are still failing
Hi @adam-urbanczyk , do you plan to make selector combining a part of this new syntax? |
Fixed all failing test cases from the previous commit: extended the grammat to handle upper and lowercase CQ types and fixed some typos
This looks ok to me. Great work @adam-urbanczyk , nice contribution! |
@adam-urbanczyk Great work, thank you. @adam-urbanczyk @dcowden How do we want to handle the new dependency (pyparse)? Should it be included directly with CadQuery, or should we just add instructions on how to install it in the docs? I think Windows users might have to jump through a few hoops to install that package. My vote would be to add logical ops. They're so powerful that I think it would be worth the effort if you're willing to do it, @adam-urbanczyk |
yes, +1 on the logical ops. on managing the dependency, that's a very good question. I did some quick prototyping a while back, and I concluded that packaging it with cadquery is not really a good idea. I extracted the source, and i found that non-trivial source code modifications were required to make it happy living in our package structure. So unfortunately I think we'll have to require an external dependency. You're right that this is a pain, especially on windows. But on another level, the installation process for CQ and all its deps is already completely out of control-- so i dont see a reason to hold this up due to one more. Instead, we need to 'lean in' to the dependency problem and shift to delivery via containers and/or conda packages-- so that we can have all the deps we want and still not make it hard for the user. |
I'll try to get this merged tonight. |
@adam-urbanczyk having logical ops as part of string selector would be awesome. |
Ready to merge. Thanks again for this contribution. I'm looking forward to putting this new selector syntax to use. I'll create a separate issue about documenting the new dependency so that it doesn't fall through the cracks. |
Thanks again @adam-urbanczyk for this work, and thanks @jmwright for merging! |
I updated the CadQuery module for FreeCAD for this change and embedded pyparsing as a library. I played around a bit with the new selector syntax and things seemed to work well. |
Good to hear. I am working on a semi-complicated model using Nth selector (which actually was the reason to develop it) . Once I am done, I can post it somwhere. |
We have a discussion thread on the Google Group for sharing work if you're interested in using that. https://groups.google.com/forum/#!topic/cadquery/mS2ITd37sQA |
Do not merge yet - WIP
So far only the grammar is implemented. It extends the current one with: