Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Byte-compiled
*.pyc

# IDE setting
.idea/

20 changes: 12 additions & 8 deletions README.txt → README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
=============================================
PROJECT
Pycado alpha version

=============================================
### Pycado alpha version

| **Build in Windows** | **Build in macOS** |
| :----: | :----: |
| <img src="./pycado/data/cnc_components.jpg" width="480" alt="demo_Windows"/> | <img src="./pycado/data/cnc_component_mac.png" width="480" alt="demo_Mac"/> |

DESCRIPTION
=============================================
Pycado is an object oriented 3D CAD scripting language based on pythonocc with a graphical interactive editor

=============================================
AUTHORS
=============================================
Julien Blanchard - julienbld --- yahoo --- fr

Charles Clément - caratorn --- gmail --- com

=============================================
HOMEPAGE
=============================================
https://github.com/julienbld/pycado


Expand Down Expand Up @@ -48,9 +53,8 @@ dependency tree.

2 - INSTALLATION
================
Pycado is based on pythonocc, so the first step is to install pythonocc, which
depends on the OpenCASCADE library (http://www.opencascade.org/), swig
(http://www.swig.org/), QScintilla(http://www.riverbankcomputing.co.uk/software/qscintilla).
Pycado is based on pythonocc, so the first step is to install [pythonocc](https://github.com/tpaviot/pythonocc-core), which
depends on the [OpenCASCADE library](http://www.opencascade.org/), [swig](http://www.swig.org/), [QScintilla](http://www.riverbankcomputing.co.uk/software/qscintilla).



Expand Down
Binary file added pycado/data/cnc_component_mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pycado/data/cnc_components.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pycado/nspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import OCC.Quantity
from OCC.Graphic3d import *
from OCC import TopExp, BRepPrimAPI, TopAbs, TopoDS, BRep
from OCC.Utils.Topology import Topo
from OCCUtils.Topology import Topo
from OCC.BRepAlgo import *
from OCC.TopoDS import TopoDS_Compound

Expand Down
6 changes: 4 additions & 2 deletions pycado/pycado.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ def main(argv=sys.argv):
# INIT DISPLAY
gui.canva.InitDriver()
#gui.canva._display.SetBackgroundImage(nspace.config["background"])
gui.canva._display.SetBackgroundImage(get_abs_filename())
#gui.canva._display.GetViewer().GetObject().SetDefaultBackgroundColor(OCC.Quantity.Quantity_NOC_YELLOW)
#gui.canva._display.SetBackgroundImage(get_abs_filename())
gui.canva._display.GetView().GetObject().SetBgGradientColors(OCC.Quantity.Quantity_NOC_NAVYBLUE,
OCC.Quantity.Quantity_NOC_SNOW,
OCC.Aspect.Aspect_GFM_VER)
gui.canva._display.View_Iso()


Expand Down
2 changes: 1 addition & 1 deletion pycado/pycado_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def build(self):
self.data = BRepAlgo_Cut(args[1].topology, args[2].topology)
ex = TopExp_Explorer()
ex.Init(self.data.Shape(), TopAbs_FACE)
self.topology = TopoDS().Face(ex.Current())
self.topology = topods_Face(ex.Current())
else:
self.value = args
self.data = BRepBuilderAPI_MakeWire()
Expand Down
5 changes: 2 additions & 3 deletions pycado/qt_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def InitDriver(self):
raise "Please set the CSF_GraphicShr environment variable."
self._display = OCCViewer.Viewer3d(self.GetHandle())
self._display.Create()
self._display.DisplayTriedron()
self._display.display_trihedron()
self._display.SetModeShaded()
self._inited = True
# dict mapping keys to functions
Expand All @@ -131,8 +131,7 @@ def set_shade_mode():
ord('S'): set_shade_mode,
ord('A'): self._display.EnableAntiAliasing,
ord('B'): self._display.DisableAntiAliasing,
ord('Q'): self._display.SetModeQuickHLR,
ord('E'): self._display.SetModeExactHLR,
ord('H'): self._display.SetModeHLR,
ord('F'): self._display.FitAll,
#ord('F'): self._display.ExportToImage("essai.BMP"),
#ord('F'): self._display.SetBackgroundImage("carrelage1.gif"),
Expand Down