Created
November 8, 2023 19:29
-
-
Save nortikin/7a192ae74021408c339fbd1999533309 to your computer and use it in GitHub Desktop.
Sverchok.v1.3.0-alpha (4ca1deb) | Blender.3.4.1 | DXF_export | 2023.11.08 | 22:29 | license: CC BY-SA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"export_version": "1.0", | |
"main_tree": { | |
"nodes": { | |
"Scripted Node Lite": { | |
"attributes": { | |
"location": [ | |
-21.153717041015625, | |
73.09312438964844 | |
], | |
"color": [ | |
0.0, | |
0.6000000238418579, | |
0.800000011920929 | |
], | |
"use_custom_color": true | |
}, | |
"properties": { | |
"n_id": "-7676151504809970721", | |
"script_name": "dxf_SN.py", | |
"script_str": "'''\nin vers v d=[[]] n=0\nin edges s d=[[]] n=0\nin pols s d=[[]] n=0\nin Tvers v d=[[]] n=0\nin Ttext s d=[[]] n=0\nin path FP d=[[]] n=0\n'''\n\n'''\n\u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0440\u0430\u0431\u043e\u0442\u044b - \n \u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432 dxf\n'''\n\n\nimport bpy\n\nself.make_operator('make')\n\n \ndef ui(self, context, layout):\n cb_str = 'node.scriptlite_custom_callback'\n layout.operator(cb_str, text='B A K E').cb_name='make'\n\n\ndef make(self, context):\n # export main definition\n def export(v,e,p,tv,tt,fp):\n import ezdxf\n from ezdxf import colors\n from ezdxf.enums import TextEntityAlignment\n\n \n\n # Create a new DXF document.\n doc = ezdxf.new(dxfversion=\"R2010\")\n\n # Create new table entries (layers, linetypes, text styles, ...).\n doc.layers.add(\"SVERCHOK_TEXT\", color=colors.RED)\n doc.layers.add(\"SVERCHOK_VERS\", color=colors.WHITE)\n doc.layers.add(\"SVERCHOK_EDGES\", color=colors.GREEN)\n doc.layers.add(\"SVERCHOK_POLYGONS\", color=colors.YELLOW)\n\n # DXF entities (LINE, TEXT, ...) reside in a layout (modelspace, \n # paperspace layout or block definition). \n msp = doc.modelspace()\n\n # Add entities to a layout by factory methods: layout.add_...() \n \n \n if e:\n for obe,obv in zip(e,v):\n edgs = []\n for ed in obe:\n msp.add_line(obv[ed[0]],obv[ed[1]], dxfattribs={\"layer\": \"SVERCHOK_EDGES\"}) \n #dxfattribs={\"color\": colors.YELLOW})\n elif p:\n for obp,obv in zip(p,v):\n for po in obp:\n points = []\n for ver in po:\n points.append(obv[ver])\n msp.add_polyline3d(points, dxfattribs={\"layer\": \"SVERCHOK_EDGES\"},close=True)\n elif v:\n #for x,y in [(0,10),(10,10),(10,0),(0,0)]:\n for ob in v:\n vers = []\n for ver in ob:\n vers.append(list(ver))\n msp.add_point(vers, dxfattribs={\"layer\": \"SVERCHOK_VERS\"})\n if tv and tt:\n for obtv, obtt in zip(tv,tt):\n for tver, ttext in zip(obtv,obtt):\n msp.add_text(\n ttext[0], height=0.1,\n dxfattribs={\n \"layer\": \"SVERCHOK_TEXT\"\n }).set_placement(tver, align=TextEntityAlignment.CENTER)\n \n # Save the DXF document.\n doc.saveas(fp[0][0])\n\n\n\n vers_,edges_,pols_,Tvers_,Ttext_,fpath_ = [],[],[],[],[],[]\n\n if self.inputs['vers'].is_linked:\n vers_ = self.inputs['vers'].sv_get()\n else: return {'FINISHED'}\n if self.inputs['edges'].is_linked:\n edges_ = self.inputs['edges'].sv_get()\n if self.inputs['pols'].is_linked:\n pols_ = self.inputs['pols'].sv_get()\n if self.inputs['Tvers'].is_linked:\n Tvers_ = self.inputs['Tvers'].sv_get()\n if self.inputs['Ttext'].is_linked:\n Ttext_ = self.inputs['Ttext'].sv_get()\n if self.inputs['path'].is_linked:\n fpath_ = self.inputs['path'].sv_get()\n else: return {'FINISHED'}\n export(vers_,edges_,pols_,Tvers_,Ttext_,fpath_)\n \n return {'FINISHED'}\n\n\n" | |
}, | |
"inputs": { | |
"vers": { | |
"bl_idname": "SvVerticesSocket", | |
"name": "vers" | |
}, | |
"edges": { | |
"bl_idname": "SvStringsSocket", | |
"name": "edges" | |
}, | |
"pols": { | |
"bl_idname": "SvStringsSocket", | |
"name": "pols" | |
}, | |
"Tvers": { | |
"bl_idname": "SvVerticesSocket", | |
"name": "Tvers" | |
}, | |
"Ttext": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Ttext" | |
}, | |
"path": { | |
"bl_idname": "SvFilePathSocket", | |
"name": "path" | |
} | |
}, | |
"bl_idname": "SvScriptNodeLite" | |
}, | |
"File Path": { | |
"attributes": { | |
"location": [ | |
-272.6387939453125, | |
-33.1668586730957 | |
], | |
"width": 149.4466552734375 | |
}, | |
"properties": { | |
"files": [ | |
{ | |
"name": "texsting_2023.dxf" | |
} | |
], | |
"directory": "D:\\users\\gorodetsky\\blender\\Sverchok 2023\\", | |
"files_num": 1 | |
}, | |
"outputs": { | |
"File Path": { | |
"bl_idname": "SvFilePathSocket", | |
"name": "File Path" | |
} | |
}, | |
"bl_idname": "SvFilePathNode" | |
}, | |
"Suzanne": { | |
"attributes": { | |
"location": [ | |
-266.9872131347656, | |
83.0323257446289 | |
] | |
}, | |
"outputs": { | |
"Vertices": { | |
"bl_idname": "SvVerticesSocket", | |
"name": "Vertices" | |
}, | |
"Edges": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Edges" | |
}, | |
"Faces": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Faces" | |
} | |
}, | |
"bl_idname": "SvSuzanneNode" | |
}, | |
"Box": { | |
"attributes": { | |
"location": [ | |
-445.6291198730469, | |
108.5241470336914 | |
] | |
}, | |
"inputs": { | |
"Size": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Size", | |
"properties": { | |
"prop_name": "Size" | |
} | |
}, | |
"Divx": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Divx", | |
"properties": { | |
"prop_name": "Divx" | |
} | |
}, | |
"Divy": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Divy", | |
"properties": { | |
"prop_name": "Divy" | |
} | |
}, | |
"Divz": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Divz", | |
"properties": { | |
"prop_name": "Divz" | |
} | |
}, | |
"Matrix": { | |
"bl_idname": "SvMatrixSocket", | |
"name": "Matrix" | |
} | |
}, | |
"outputs": { | |
"Vers": { | |
"bl_idname": "SvVerticesSocket", | |
"name": "Vers", | |
"properties": { | |
"description": "Box vertices" | |
} | |
}, | |
"Edgs": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Edgs" | |
}, | |
"Pols": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Pols" | |
} | |
}, | |
"bl_idname": "SvBoxNodeMk2" | |
}, | |
"Viewer Draw": { | |
"attributes": { | |
"location": [ | |
-23.717731475830078, | |
139.36524963378906 | |
], | |
"hide": true | |
}, | |
"properties": { | |
"selected_draw_mode": "facet" | |
}, | |
"inputs": { | |
"Vertices": { | |
"bl_idname": "SvVerticesSocket", | |
"name": "Vertices", | |
"properties": { | |
"custom_draw": "draw_property_socket" | |
} | |
}, | |
"Edges": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Edges", | |
"properties": { | |
"custom_draw": "draw_property_socket" | |
} | |
}, | |
"Polygons": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Polygons" | |
}, | |
"Matrix": { | |
"bl_idname": "SvMatrixSocket", | |
"name": "Matrix" | |
}, | |
"Vector Color": { | |
"bl_idname": "SvColorSocket", | |
"name": "Vector Color", | |
"properties": { | |
"custom_draw": "draw_color_socket", | |
"prop_name": "vector_color" | |
} | |
}, | |
"Edge Color": { | |
"bl_idname": "SvColorSocket", | |
"name": "Edge Color", | |
"properties": { | |
"custom_draw": "draw_color_socket", | |
"prop_name": "edge_color" | |
} | |
}, | |
"Polygon Color": { | |
"bl_idname": "SvColorSocket", | |
"name": "Polygon Color", | |
"properties": { | |
"custom_draw": "draw_color_socket", | |
"prop_name": "polygon_color" | |
} | |
}, | |
"attrs": { | |
"bl_idname": "SvStringsSocket", | |
"name": "attrs", | |
"attributes": { | |
"hide": true | |
}, | |
"properties": { | |
"quick_link_to_node": "SvVDAttrsNodeMk2" | |
} | |
} | |
}, | |
"bl_idname": "SvViewerDrawMk4" | |
}, | |
"Viewer Index+": { | |
"attributes": { | |
"location": [ | |
-43.2496337890625, | |
-231.01461791992188 | |
], | |
"hide": true | |
}, | |
"inputs": { | |
"verts": { | |
"bl_idname": "SvVerticesSocket", | |
"name": "verts" | |
}, | |
"edges": { | |
"bl_idname": "SvStringsSocket", | |
"name": "edges" | |
}, | |
"faces": { | |
"bl_idname": "SvStringsSocket", | |
"name": "faces" | |
}, | |
"matrix": { | |
"bl_idname": "SvMatrixSocket", | |
"name": "matrix" | |
}, | |
"text": { | |
"bl_idname": "SvStringsSocket", | |
"name": "text" | |
} | |
}, | |
"bl_idname": "SvIDXViewer28" | |
}, | |
"Strings Tools": { | |
"attributes": { | |
"location": [ | |
-274.0199890136719, | |
-150.08255004882812 | |
], | |
"color": [ | |
0.5331429243087769, | |
0.9872658848762512, | |
1.0 | |
], | |
"use_custom_color": true | |
}, | |
"properties": { | |
"current_op": "split", | |
"sockets_signature": "tcs t", | |
"xi_": 7 | |
}, | |
"inputs": { | |
"Text": { | |
"bl_idname": "SvTextSocket", | |
"name": "Text", | |
"properties": { | |
"prop_name": "text", | |
"custom_draw": "draw_prop_socket", | |
"label": "Text" | |
} | |
}, | |
"Characters": { | |
"bl_idname": "SvTextSocket", | |
"name": "Characters", | |
"properties": { | |
"prop_name": "chars", | |
"custom_draw": "draw_prop_socket", | |
"label": "Spliter" | |
} | |
}, | |
"Number": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Number", | |
"properties": { | |
"prop_name": "xi_", | |
"custom_draw": "draw_prop_socket", | |
"label": "Max Split" | |
} | |
} | |
}, | |
"outputs": { | |
"Out": { | |
"bl_idname": "SvTextSocket", | |
"name": "Out" | |
} | |
}, | |
"bl_idname": "SvStringsToolsNode" | |
}, | |
"Note": { | |
"attributes": { | |
"location": [ | |
-493.69744873046875, | |
-152.00048828125 | |
], | |
"width": 187.4244384765625, | |
"color": [ | |
0.5, | |
0.5, | |
1.0 | |
], | |
"use_custom_color": true | |
}, | |
"properties": { | |
"n_id": "-7351027640976024385", | |
"text": "your text here your text here your text" | |
}, | |
"inputs": { | |
"Text In": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Text In" | |
} | |
}, | |
"outputs": { | |
"Text Out": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Text Out" | |
} | |
}, | |
"bl_idname": "NoteNode" | |
}, | |
"List Split": { | |
"attributes": { | |
"location": [ | |
-37.1268310546875, | |
-176.87799072265625 | |
], | |
"hide": true | |
}, | |
"properties": { | |
"level_unwrap": 2 | |
}, | |
"inputs": { | |
"Data": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Data" | |
}, | |
"Split": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Split", | |
"properties": { | |
"prop_name": "split" | |
} | |
} | |
}, | |
"outputs": { | |
"Split_001": { | |
"bl_idname": "SvTextSocket", | |
"name": "Split" | |
} | |
}, | |
"bl_idname": "SvListSplitNode" | |
}, | |
"Stethoscope MK2": { | |
"attributes": { | |
"location": [ | |
125.14999389648438, | |
-51.258995056152344 | |
], | |
"color": [ | |
0.5331429243087769, | |
0.9872658848762512, | |
1.0 | |
], | |
"use_custom_color": true | |
}, | |
"properties": { | |
"text_color": [ | |
0.949999988079071, | |
0.949999988079071, | |
0.949999988079071 | |
], | |
"location_theta": 1.0080000162124634, | |
"num_elements": 1 | |
}, | |
"inputs": { | |
"Data": { | |
"bl_idname": "SvStringsSocket", | |
"name": "Data" | |
} | |
}, | |
"bl_idname": "SvStethoscopeNodeMK2" | |
} | |
}, | |
"links": [ | |
{ | |
"from_node": "Suzanne", | |
"from_socket": "Vertices", | |
"to_node": "Scripted Node Lite", | |
"to_socket": "vers" | |
}, | |
{ | |
"from_node": "Suzanne", | |
"from_socket": "Faces", | |
"to_node": "Scripted Node Lite", | |
"to_socket": "pols" | |
}, | |
{ | |
"from_node": "Box", | |
"from_socket": "Vers", | |
"to_node": "Scripted Node Lite", | |
"to_socket": "Tvers" | |
}, | |
{ | |
"from_node": "List Split", | |
"from_socket": "Split_001", | |
"to_node": "Scripted Node Lite", | |
"to_socket": "Ttext" | |
}, | |
{ | |
"from_node": "File Path", | |
"from_socket": "File Path", | |
"to_node": "Scripted Node Lite", | |
"to_socket": "path" | |
}, | |
{ | |
"from_node": "Suzanne", | |
"from_socket": "Vertices", | |
"to_node": "Viewer Draw", | |
"to_socket": "Vertices" | |
}, | |
{ | |
"from_node": "Suzanne", | |
"from_socket": "Edges", | |
"to_node": "Viewer Draw", | |
"to_socket": "Edges" | |
}, | |
{ | |
"from_node": "Suzanne", | |
"from_socket": "Faces", | |
"to_node": "Viewer Draw", | |
"to_socket": "Polygons" | |
}, | |
{ | |
"from_node": "Box", | |
"from_socket": "Vers", | |
"to_node": "Viewer Index+", | |
"to_socket": "verts" | |
}, | |
{ | |
"from_node": "List Split", | |
"from_socket": "Split_001", | |
"to_node": "Viewer Index+", | |
"to_socket": "text" | |
}, | |
{ | |
"from_node": "Note", | |
"from_socket": "Text Out", | |
"to_node": "Strings Tools", | |
"to_socket": "Text" | |
}, | |
{ | |
"from_node": "Strings Tools", | |
"from_socket": "Out", | |
"to_node": "List Split", | |
"to_socket": "Data" | |
}, | |
{ | |
"from_node": "List Split", | |
"from_socket": "Split_001", | |
"to_node": "Stethoscope MK2", | |
"to_socket": "Data" | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment