{ "info": { "author": "3DLirious", "author_email": "3DLirious@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# BlendSCAD - bridging the gap between Blender and OpenSCAD\r\n---\r\nBlendSCAD is a fork of [Michael Mlivoncic's](https://github.com/miguelitoelgrande) BlenderSCAD module, with the name changed slightly to avoid confusion with the original. Dev elopement on the original seems to be paused at the moment; it is hoped that this fork can help revive the project and take it in new directions. This fork has the following design goals:\r\n\r\n* Compatibility with [SolidPython](https://github.com/SolidCode/SolidPython); the goal is for the same scripts to run on each.\r\n* Add new OpenSCAD features, such as text. Aiming for full compatibility with OpenSCAD; the only significant issue at the moment appears to be the Minkowski function.\r\n* Add Blender-only extras and enhancements, such as the ability to work with vertex colors or textures to support 3D printable full color models, and additional modifiers such as Solidify.\r\n* Available on PyPI, and can be installed via pip.\r\n* The BlendSCAD Panel will not be support at the moment, and won't be kept up to date with changes in the underlying module. This may be picked back up again in the future.\r\n\r\nInstalling in Blender's Python 3 with pip; Blender doesn't come with pip, so we have to install it first:\r\n1. Download [get-pip.py](https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py)\r\n2. Install pip\r\n```sh\r\n\"C:\\Program Files\\Blender Foundation\\Blender\\2.78\\python\\bin\\python.exe\" get-pip.py\r\n```\r\n3. Install BlendSCAD\r\n```sh\r\n\"C:\\Program Files\\Blender Foundation\\Blender\\2.78\\python\\bin\\python.exe\" -m pip install blendscad\r\n```\r\n\r\nThe above path is for Blender 2.78 installed in the default location on Windows; modify accordingly for your OS.\r\n\r\nThe original README is shown below:\r\n---\r\nBlender is a powerful piece of Open Source software which is also useful in the 3D printing space. Coming from OpenSCAD or Tinkercad, there are some issues at the first glance:\r\n\r\n* Revisiting and changing a model seems to be difficult - Joining meshes is less attractive than grouping/ungrouping objects\r\n* Undo functionality is not that advanced.\r\n* The parametric approach of OpenSCAD is very powerful and yet easy to learn. Blender's Python console is something you may not even be aware of and parameterizing your first objects with OpenSCAD is definitely much easier.\r\n* Blender's UI (i.e. the default theme)is way too dark to provide this warm and welcome feeling of Tinkercad or OpenSCAD :-)\r\n\r\nThis little project started as a proof of concept implementation as I'm just familiarizing myself with Blender and Python. Meanwhile it has matured quite a bit and is a really nice enhancement for Blender. \r\nHere is a screenshot to show the basic idea: \r\n\r\n### OpenSCAD code\r\n\r\nBtw: It's the OpenJSCAD logo\r\n\r\n
module logodemo() {\r\n scale([10,10,10]) { \r\n translate([0,0,1.5]) {\r\n union() {\r\n difference() {\r\n cube(size=3, center=true);\r\n sphere(r=2, center=true);\r\n }\r\n intersection() {\r\n sphere(r=1.3, center=true);\r\n cube(size=2.1, center=true);\r\n }\r\n\t }\r\n }\r\n }\r\n}\r\nlogodemo();\r\n\r\n\r\n\r\n\r\n### Translated to BlenderSCAD\r\n\r\n...with added some color and treated as two grouped objects\r\n\r\ndef logodemo(): \r\n\tscale([10,10,10], \r\n\t translate([0,0,1.5] \r\n\t\t , group( \r\n\t\t\t color(purple, difference(\r\n\t\t\t\t cube([3,3,3], center=true)\r\n\t\t\t , sphere(r=2, center=true)\r\n\t\t\t ))\r\n\t\t , color(yellow, intersection(\r\n\t\t\t\t sphere(r=1.3, center=true)\r\n\t\t\t , cube([2.1,2.1,2.1], center=true)\r\n\t\t ))\t \r\n\t\t )\r\n\t )\r\n\t)\r\n\r\nlogodemo()\r\n\r\n\r\n I've started developing BlenderSCAD on Blender 2.68/2.69\\. The current version works fine with Blender 2.68 to the recent 2.74 and may still work on older Blender releases (not tested, though). OS wise, I'm using Blender on Windows7 64bit, but also tested it on Ubuntu (well sideloaded on an Android tablet).\r\n\r\n## Install Instructions\r\n\r\nInstalling BlenderSCAD is fairly simple: Meanwhile, I've split the project into a python module _blenderscad_, default user prefs and startup files for the _config_ folder and the BlenderSCAD panel to be placed in the _addons_ folder. Just installing the module is fine, the other two parts can be considered optional. Furthermore, there is a demo script _blenderscad_demo.py_ and some more demo files in the _tests_ and _examples_ folders.\r\n\r\n#### The blenderscad module\r\n\r\nFirst, place the blenderscad directory in Blender's module path:\r\n\r\n
[installpath]\\blender-2.69\\2.69\\scripts\\modules\\blenderscad\r\nor\r\n[installpath]\\blender-2.74\\2.74\\scripts\\modules\\blenderscad\r\n\r\n\r\nAs an alternative, you can also set a path in the console or the demo script to the folder containing the modules. \r\n\r\n#### UI Look and Feel\r\n\r\nYou can use my **startup.blend** and **userpref.blend** files from the config subfolder optionally. These will provide my Blender Theme adjustments and screen area setup as shown in the screenshot above. Place the content of the \"config\" folder into the Blender's config folder:\r\n\r\n
%USERPROFILE%\\AppData\\Roaming\\Blender Foundation\\Blender\\2.69\\config\r\nor\r\n%USERPROFILE%\\AppData\\Roaming\\Blender Foundation\\Blender\\2.74\\config\r\n\r\n\r\nif you are using Windows (Otherwise, refer to the Blender documentation).\r\n\r\n#### BlenderSCAD panel\r\n\r\nWell, this exeeds the original scope of providing OpenSCAD like operations and is rather similar to working with TinkerCAD. If you want to give it a try, install the addon and activate it in the user preferences:\r\n\r\n
[installpath]\\blender-2.69\\2.69\\scripts\\addons\\blenderscad_toolbar.py\r\nor\r\n[installpath]\\blender-2.74\\2.74\\scripts\\addons\\blenderscad_toolbar.py\r\n\r\n\r\n#### Getting started\r\n\r\nSAVE all open work first, better go to a clean document. Open the demo script _blenderscad_demo.py_ in Blender's internal text editor and uncomment the demo section you want to try out. Simply use \"run script\". This is the easiest way. You can also save your script as part of a .blend file. Again, caution, there is a line in most of my demo scripts to wipe all objects of the open scene first for rapid testing. Congratulations, Blender is now your OpenSCAD-like IDE. You can even have the code compile while typing (Check \"Live Edit\" in the editor)\r\n\r\n#### Alternatively, run via Python Console\r\n\r\nThis option is preferred if you use an external editor for the code.\r\n\r\n
#Optionally, first clear command history in Python Console:\r\nbpy.ops.console.clear(history=True)\r\nfilename = \"\r\n\r\nIn general, I recommend to start Blender from a command line (Windows or Linux). This way you see all error messages and warnings.\r\n\r\n#### A few hints\r\n\r\nBlender files usually grow with all unlinked objects. It will garbage clean whenever you save and reopen the document. In order to make the \"Live Edit\" option work reasonable, I explicitly force the deletion (unlink) of intermediate objects and meshes (e.g. before union). Therefore, the files should stay cleaner than while editing a blender file in the usual way. \r\nA last word of \"warning\": Pay attention to where your source file is saved. _ALT+S_ will save the file in the editor, _CTRL+S_ will save the \"materialized\" version of that file inside blender. Changes may be lost if you resync.\r\n\r\n### Supported:\r\n\r\n* cube\r\n* cylinder\r\n* sphere\r\n* circle\r\n* square\r\n* polygon\r\n* polyhedron\r\n\r\n* translate\r\n* rotate\r\n* mirror\r\n* scale\r\n* resize\r\n* color\r\n\r\n* union\r\n* difference\r\n* intersection\r\n\r\n* projection\r\n* *linear_extrude\r\n* rotate_extrude\r\n* hull\r\n\r\n* surface\r\n* import_, import_stl , *import_dxf\r\n* export, export_stl, *export_dxf\r\n\r\n* hexagon\r\n* octagon\r\n* ellipsoid\r\n* rcube\r\n* roundedBox\r\n\r\n* special variables: fs, fa, fn (~ $fs, $fa, $fn)\r\n* string functions: echo, str, *search\r\n* math functions: lookup, rands, sign, sin , cos,...\r\n\r\n### Extras\r\n\r\n* join, split\r\n* group, ungroup\r\n* clone, destruct\r\n\r\n* round_edges\r\n* dissolve\r\n\r\n* +several (OpenSCAD) demos\r\n* ...\r\n\r\n### Missing\r\n\r\n* minkowski\r\n* norm\r\n* multimatrix\r\n* ...\r\n\r\n## The BlenderSCAD Panel\r\n\r\nThis is currently the most active area of my development - subject to change ;-) I wanted to have some interactivity to try some additional operators and tweaks easily. As this is a really simple to do in Blender, I've defined a panel. This is how the first version looked like:\r\n\r\n\r\n\r\nIt mainly reuses some code I've written for the BlenderSCAD enhancements. A very handy thing are the multi-object boolean operations: 3 clicks to have a cube, a cylinder and a sphere on the screen, a couple of clicks to align them, selecting several objects (Shift+Right Mouse), then just hit one of the Boolean buttons. Behind the scenes, it will create the required modifiers and apply them. A great productivity gain, I would say. Give it a try. Almost as convenient as Tinkercad (Group and Hole and Undo/Ungroup) still to be done. The object cleanup (using limited dissolve) really cleans up most resulting geometry. \r\n\r\nIn general, most operations will be applied to the set of selected objects. \r\n\r\nObject selection differs from the default Blender setup. I've changed the assignment of the mouse selection in order to make tablet operations (without a keyboard) possible.\r\n\r\nSpeaking of geometry: The user will not even realize when the code is switching from Object to Edit mode (something not always straight forward in Blender, especially when scripting via Python?). There is a Debug-Button which will toggle displaying all object edges even in object mode. Blender could/can be so easy!\r\n\r\nAs I need to see the \"real\" console output anyways, I've decided to switch from the single window-multiple area approach to a triple window approach.\r\n\r\n\r\n\r\nJust tweak the paths in the text opening in the startup code (right) and run it. This will make the Panel appear - no full-fledged add-on at the time being.\r\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/3DLIRIOUS/BlendSCAD", "keywords": null, "license": "GPL-3", "maintainer": null, "maintainer_email": null, "name": "BlendSCAD", "package_url": "https://pypi.org/project/BlendSCAD/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/BlendSCAD/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/3DLIRIOUS/BlendSCAD" }, "release_url": "https://pypi.org/project/BlendSCAD/20170429.0.0.2/", "requires_dist": null, "requires_python": null, "summary": "OpenSCAD-ify Blender", "version": "20170429.0.0.2" }, "last_serial": 2839485, "releases": { "20170429.0.0.2": [ { "comment_text": "", "digests": { "md5": "007a310bd1b02fba1c0f351cbde8935e", "sha256": "26080d52da18d80a4a1cde6b28c8074efebd60a8474854b454fd5835f2117532" }, "downloads": -1, "filename": "BlendSCAD-20170429.0.0.2.zip", "has_sig": false, "md5_digest": "007a310bd1b02fba1c0f351cbde8935e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 267414, "upload_time": "2017-04-29T18:44:50", "url": "https://files.pythonhosted.org/packages/c7/1b/3606162a1908336f45ee8d95b48f797945c407bf4b3b6b65dcc47fb84eb1/BlendSCAD-20170429.0.0.2.zip" } ], "20170429.0.0.2b0": [ { "comment_text": "", "digests": { "md5": "fd8dbe541457b8ca2d7e47cfe3732b35", "sha256": "943b810b5fc72c09bf9d23b9416ec67cecec1a2ed82be007cb18c9f645cef664" }, "downloads": -1, "filename": "BlendSCAD-20170429.0.0.2b0.zip", "has_sig": false, "md5_digest": "fd8dbe541457b8ca2d7e47cfe3732b35", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 267567, "upload_time": "2017-04-29T19:23:32", "url": "https://files.pythonhosted.org/packages/61/d9/b749418f32255a7cbed3a7cfbe3d161bfcc0c67f203e3d7e63ea0968ba1b/BlendSCAD-20170429.0.0.2b0.zip" } ], "20170429.0.0.2rc0": [ { "comment_text": "", "digests": { "md5": "da590e3f7d39e71ef0588051c71f721c", "sha256": "344bfc68bccfddb3bfe0e59a296aa699a9f82e951a0cf705ef40726935fea9cf" }, "downloads": -1, "filename": "BlendSCAD-20170429.0.0.2rc0.zip", "has_sig": false, "md5_digest": "da590e3f7d39e71ef0588051c71f721c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 267652, "upload_time": "2017-04-29T19:30:10", "url": "https://files.pythonhosted.org/packages/40/2b/d0aabc5a58bb4e7ff87156f0c592a025f4cdbb97a837b1b2ac0cbf8c86cb/BlendSCAD-20170429.0.0.2rc0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "007a310bd1b02fba1c0f351cbde8935e", "sha256": "26080d52da18d80a4a1cde6b28c8074efebd60a8474854b454fd5835f2117532" }, "downloads": -1, "filename": "BlendSCAD-20170429.0.0.2.zip", "has_sig": false, "md5_digest": "007a310bd1b02fba1c0f351cbde8935e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 267414, "upload_time": "2017-04-29T18:44:50", "url": "https://files.pythonhosted.org/packages/c7/1b/3606162a1908336f45ee8d95b48f797945c407bf4b3b6b65dcc47fb84eb1/BlendSCAD-20170429.0.0.2.zip" } ] }/BlenderSCAD.py\r\nexec(compile(open(filename).read(), filename, 'exec'))