-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solid Nodes and Extra-Nodes #3377
Conversation
oh lol. i see you have Mesh to Solid already. i'm blind. |
Well. We have to decide something... We discussed this in portnov/sverchok-extra#15 |
@portnov I took part some of the code from sverchok-extra to make this PR work, Sverchok-extra is a extra step, the easiest, but another step. I think moving sv-extra to extra-nodes will encourage the users to install the dependencies and to use the nodes ... |
However the nodes seem to work. What is going on? :)
The same node works if I pass primitive like "Box (Solid)" into it. |
The path has to be to the folder where FreeCadApp.dll (and the FreeCadBase.exe..) is placed... In my case is something like
The Set button saves a file in python\lib\site-packages called freecad_path.pth with the supplied path so it stays permanently on the system... maybe it could be set every time you open blender.. I thought this solution was cleaner but I'm open to suggestions
Probably you already had a path in your system to the right version of FreeCAD About the 4th point: The FreeCAD api report is a bit obscure..., the Fillet and Chamfer nodes will fail if the Radius/Distance is to high to perform the operation without errors, reducing the value should make it work. maybe I should add a try/except to raise a more clear explanation |
looks like the vdmk3 might need an alternative, for solids to avoid that chevron shading artifact in the fillet, but if each surface that is currently outlined by an edge is ultimately just one "polygon", then things become tricky. |
@zeffi i was thinking about this... in grashopper some nodes have a draw method that works like a inner viewer draw... now that we have Surfaces, Curves and Solids maybe could try something similar... The faces are tesselated but only the "real" edges are represented.... |
"Solid Viewer" as a separate node maybe, an opportunity to go beyond my silly experiments. |
should the Solids get their own separate menu? even if it's only a really minor menu system. - input
- operators
- convert
- output |
@zeffi you mean taking it out of the general menu or keep it there and also making another smaller menu? |
yes, to do this justice i think a separate menu has merit. Especially for the new users, who will be able to see what is available from the FreeCAD module in a nice menu/submenu form |
well, in the overarching case that you paint, maybe a freeCAD menu would indeed make sense. In that case I would vote to not mix those nodes in the Sverchok menu at all. but let's see. |
Does this mean I have to press this button each time I run blender? Wouldn't it be enough to just save the path in sverchok settings and initialize sys.path accordingly at registration? |
|
|
? |
👍 |
🎉 now to make some coool stuff with it. |
https://vk.com/wall-35076122_11309
|
Hello everyone!
I see that is possible to slice the solid list and make operation on it, but It would be nice to add a node to select parts by name, I have to try… If could be of some use here the node code: |
I would suggest
|
Hello! working in progress... Slowly learning Sverchok framework... "read node" "write node" ( mesh/solid modes) |
|
Yes, I think Exchange would be perfect |
hello! I fixed some issues related to file array and filter by name( now use .label prop in freecad instead of .name... I noticed that if you rename something in freecad it changes only the label) |
@rastart wouldn't you like to make a pull request? (https://www.youtube.com/playlist?list=PLRqwX-V7Uu6ZF9C0YMKuns9sLDzK6zoiV) |
Ok, I should have pull the request! |
Hello, I'm evaluating a convenient method to pass filter labels to read node.
but in huge assembly would be a mess. Have you some feedbacks about it? |
class SvShowFcstdNamesOp(bpy.types.Operator):
bl_idname = "node.sv_show_fcstd_names"
bl_label = "Show contents"
bl_options = {'INTERNAL', 'REGISTER'}
bl_property = "option"
def get_items(self, context): ...
option : EnumProperty(items = get_items)
idtree : StringProperty()
idname : StringProperty()
def execute(self, context):
tree = bpy.data.node_groups[self.idtree]
node = tree.nodes[self.idname]
node.name_filter = self.option
return {'FINISHED'}
def invoke(self, context, event):
context.space_data.cursor_location_from_region(event.mouse_region_x, event.mouse_region_y)
wm = context.window_manager
wm.invoke_search_popup(self)
return {'FINISHED'} ... def draw_buttons():
wrapper_tracked_ui_draw_op(layout, SvShowFcstdNamesOp.bl_idname, icon=...) This will show drop-down menu similar to one that appears by Alt-Space. |
I've referenced this discussion at https://wiki.osarch.org/index.php?title=Sverchok if anyone wants to expand the text that would be great. Or at least check that what I've written makes sense. |
added read sketch node! Until now I just tested the nodes with random operations and I didnt experiment critical issues, mainly write node need some attention to avoid recursive overloading if the same freecad file is involved in read/write operation. |
Can you output curves as |
OK! sverchok.utils.curve.core.SvCurve instances worked to translate freecad line, circle and arc. |
spreadsheet node preview... read/write mode |
I just updated the freecad exchange nodes. READ NODE -> add some sort logic (ex. to read just the body final shape without import all features shape) I don't think I'm going to add more features so If you have some reviews from now I'll work just on refactoring! Meanwhile I'll keep making design experiments with these nodes... |
for curves other than segments and circles I manged like that: |
freecad link disabled could you give me the link again please |
This PR adds two features:
Extra nodes: The ability to add nodes with external dependencies.
A new tab has been added to the sverchok preferences to handle the dependencies
In case of missing dependencies the nodes wont be loaded and they wont appear on the menu.
If a file is loaded with nodes that require dependencies not found a Dummy node will be created on the Fly
The dependent nodes have to be added to the dummy_nodes_dict in utils/dummy_nodes
I followed the strategy of the old_nodes loading but generating the dummy_nodes when needed
Also if a json is loaded with nodes that require dependencies not found they will be replaced by a Dummy node
Solid Nodes: A set of nodes dependent on FreeCad to perform operations with solids (BRep)
Inspired in https://blenderartists.org/t/freecad-sverchok-subd-to-nurbs/1218702
Using FreeCAD as Python module a set of nodes to deal with solids
Installation
A python 3.7 FreeCad is needed. a windows version can be found here https://github.com/sgrogan/FreeCAD/releases/tag/PY3.7-win
Then the path to the FreeCad bin folder has to be placed in the Extra-Nodes ->FreeCad-> TextField and click on Set Path
Solids are heavier than meshes but perform better boolean operations (even with co-planar faces)
The module also offers variable radius Fillet
Chamfer with different angles:
And more to came (import/export to STL and BRep, center of mass, solid to NURBS...)