codecad

所属分类:GPU/显卡
开发工具:Python
文件大小:1216KB
下载次数:0
上传日期:2020-04-03 20:13:13
上 传 者sh-1993
说明:  用Python编程CAD的实验
(An experiment with programming CAD in Python)

文件列表:
.travis.yml (527, 2020-04-04)
LICENSE (35141, 2020-04-04)
codecad (0, 2020-04-04)
codecad\__init__.py (216, 2020-04-04)
codecad\assemblies.py (5828, 2020-04-04)
codecad\cl_util (0, 2020-04-04)
codecad\cl_util\__init__.py (2311, 2020-04-04)
codecad\cl_util\assert.cl (1179, 2020-04-04)
codecad\cl_util\assert.h (1272, 2020-04-04)
codecad\cl_util\cl_assert.py (3241, 2020-04-04)
codecad\cl_util\cl_buffer.py (6056, 2020-04-04)
codecad\cl_util\codegen.py (3125, 2020-04-04)
codecad\cl_util\indexing.h (510, 2020-04-04)
codecad\cl_util\opencl_manager.py (4658, 2020-04-04)
codecad\cl_util\parallel_sum.cl (795, 2020-04-04)
codecad\cl_util\parallel_sum.h (604, 2020-04-04)
codecad\cl_util\parallel_sum.py (2628, 2020-04-04)
codecad\cl_util\util.cl (382, 2020-04-04)
codecad\cl_util\util.h (183, 2020-04-04)
codecad\grid_eval.cl (1334, 2020-04-04)
codecad\grid_eval.py (103, 2020-04-04)
codecad\mass_properties.cl (2456, 2020-04-04)
codecad\mass_properties.py (8000, 2020-04-04)
codecad\math.py (461, 2020-04-04)
codecad\nodes (0, 2020-04-04)
codecad\nodes\__init__.py (171, 2020-04-04)
codecad\nodes\codegen.py (5207, 2020-04-04)
codecad\nodes\node.py (3997, 2020-04-04)
codecad\nodes\program.py (2385, 2020-04-04)
codecad\nodes\scheduler.py (5318, 2020-04-04)
codecad\rendering (0, 2020-04-04)
codecad\rendering\__init__.py (4532, 2020-04-04)
codecad\rendering\bitmap.cl (823, 2020-04-04)
codecad\rendering\bitmap.py (918, 2020-04-04)
codecad\rendering\bom.py (300, 2020-04-04)
codecad\rendering\image.py (552, 2020-04-04)
codecad\rendering\matplotlib_mesh.py (335, 2020-04-04)
... ...

============================================================= CodeCad: A programming CAD based on signed distance functions ============================================================= **The project is dead** Some good points: * The modeling API turned out to be surprisingly comfortable. Might be worth reusing in some later project. * OpenCL and Python is an awesome combination. ... and some bad points .. * SDF is a neat way to represent geometry, but there are some serious drawbacks * It's hard to make them robust. Things like `s.offset(-1).offset(1)` tend to break the invariants create weird glitches. This becomes extra visible when using the distance function value for shading, but is hard to avoid even when just working for surface export. * While physical objects are mostly comprised of their insides, the surface is where the interesting things happen and it is a bit wastefull to have to *find* the surface agin for every rendering operation, physics query... * Only code for modelling is not good enough. While some things are easier than with GUI clickery, most are more difficult and I'm still looking for a way that is bettern than either of these. Now you can enjoy the old description: Inspired by OpenSCAD and ImplicitCad, implemented in Python using OpenCL for computing power. .. image:: docs/logo.png :alt: CodeCad cube logo Currently CodeCad consists mostly of an API for representing and manipulating geometry using CSG operations and exports to STL and image. There is also a simple part/assembly model and BOM generator. Goals ----- At this stage the main goal is to have usability on par with OpenSCAD. We're not there yet, although some useable models can already be created. In the long term this should have a working GUI and parametric sketch tools. Who knows what's next. Maybe turning this into a slicer? Requirements ------------ The main requirement to run CodeCad is a working OpenCL implementation. Your GPU should provide one, or try POCL_. CodeCad might work on Windows, but it hasn't been tested. Example Code ------------ The cube at the beginning of this file was generated by the following piece of code: .. code:: python import codecad from codecad.shapes import * width = 0.6 stroke = 0.2 # Build the C shape 1 unit high c = (rectangle(width, 1 - width + stroke / 2) + circle(d=width).translated_y((1 - width) / 2) + circle(d=width).translated_y(-(1 - width) / 2)) c = c.shell(stroke) c -= rectangle(width, 1 - width).translated_x(width / 2) # Scale it to 1 unit sized cube and prepare for adding c = (c .scaled(0.6) .extruded(0.12) .rotated_x(90) .translated_y(-0.5)) # Put the logo together logo = box() + c + c.rotated_z(90) logo = (logo .scaled(100) .rotated_z(-45) .rotated_x(15)) codecad.commandline_render(logo) .. _POCL: http://portablecl.org/

近期下载者

相关文件


收藏者