# cadviewer **Repository Path**: wwzggz/cadviewer ## Basic Information - **Project Name**: cadviewer - **Description**: Simple 3D CAD app using PythonOCC and PyQt5 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2020-05-16 - **Last Updated**: 2024-07-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # cadviewer Simple 3D CAD app using PythonOCC and PyQt5 This repo is like an old attic in a sense. It contains various code that I have written as I have experimented with what and how I might go about writing a CAD application built on PythonOCC. I decided to post it on GitHub. I stumbled across some work I did a few years ago, where I started to build a simple CAD app using PythonOCC running on Python 2.7 using PyQt4. Having not looked at it in over 3 years, I wasn't sure it would be worth the trouble to get it working again with PyhonOCC version 7.4.0 while switching to Python 3 and PyQt5 all at once. A screenshot from some old code posted online: https://sites.google.com/site/pythonocc/cadviewer reminds me that I was using PythonOCC version 0.16.3-dev at that time. With the recent release of PyOCC version7.4.0-beta, I decided to give it a go. I asked Thomas Paviot for useful resources to help me understand the changes in the API from version 0.16 to the current version. His advice was very helpful: """ pythonocc-0.16.3 is 4 years old, in the meantime code has changed because of : * API changes from opencascade. Have a look at the release notes for each release. Most changes occurred when switching to occt7x series (see https://www.opencascade.com/content/previous-releases for an history of opencascascade releases) ; * changes in pythonocc itself. There have been two major changes that you have to know about while porting your old code to the new release : 1. The package structure has changed. You have to move all 'from OCC.xxx import xxx' to 'from OCC.Core.xxx import xxx'. That's not a big deal. 2. There is not Handle anymore. GetHandle and GetObject methods have disappeared. Just pass the object itself, the wrapper decides wether it has to pass the Handle or the Object to the C++ layer. You can check this commit (https://github.com/tpaviot/pythonocc-demos/commit/e59acdce5720d84ce76134789b48c268e36446d6#diff-68b70730ce65eb74e098809766ab3d0d), where we ported the old 'occ bottle example'. """ Jan 4, 2020: Progress has been better than I had hoped. The basic GUI is all there with all the widgets, STEP files can be loaded and they show up both in the display and with their correct assembly structure in the assembly/parts tree, The RMB context menu works, Workplanes can be created using three different methods, The calculator works and seems to be communicating with the main window. Here's my todo list, roughly in order of priority: Get toolbar buttons working. Modify Utility functions to output to a QtDialog rather than to console Get 'Modify 3D' funcitons working Clean up code with a linter. Assign a version number. Add abiltiy to write STEP file of assembly selected from tree. Add ability to create, modify and move 3D parts & assemblies.