Skip to content

Instantly share code, notes, and snippets.

View jf---'s full-sized avatar

Jelle Feringa jf---

View GitHub Profile
@jf---
jf--- / occ_assimpy.py
Last active December 7, 2016 17:09
use assimp to load meshes in pythonocc
def mesh_pyassimp(pth):
import pyassimp
scene = pyassimp.load(pth)
meshes = []
for msh in scene.meshes:
meshes.append((msh.vertices, msh.faces, msh.normals))
return meshes
@jf---
jf--- / bottle.py
Created May 12, 2016 20:52
pythonocc bottle example
from OCC.STEPControl import STEPControl_Reader
from OCC.Graphic3d import Graphic3d_NOM_STEEL
from OCC.BRepAlgoAPI import BRepAlgoAPI_Cut
from OCC.Display.SimpleGui import init_display
from OCC.BRepPrimAPI import BRepPrimAPI_MakeBox
from OCC.gp import gp_Vec, gp_Trsf
from OCC.BRepBuilderAPI import BRepBuilderAPI_Transform
# loads file
@jf---
jf--- / bottle.py
Created May 12, 2016 20:13
pythonocc bottle example
import math
from OCC.gp import gp_Pnt, gp_OX, gp_Vec, gp_Trsf, gp_DZ, gp_Ax2, gp_Ax3, gp_Pnt2d, gp_Dir2d, gp_Ax2d
from OCC.GC import GC_MakeArcOfCircle, GC_MakeSegment
from OCC.GCE2d import GCE2d_MakeSegment
from OCC.Geom import Geom_Plane, Geom_CylindricalSurface, Handle_Geom_Plane, Handle_Geom_Surface
from OCC.Geom2d import Geom2d_Ellipse, Geom2d_TrimmedCurve, Handle_Geom2d_Ellipse, Handle_Geom2d_Curve
from OCC.BRepBuilderAPI import BRepBuilderAPI_MakeEdge, BRepBuilderAPI_MakeWire, BRepBuilderAPI_MakeFace, \
BRepBuilderAPI_Transform
@jf---
jf--- / ipy.qml
Created February 2, 2016 13:21
WIP: ipython qml component
import QtQuick 2.0
import IPython 1.0
Item {
id: ipy_shell
IPyShellQml {
id: ipy_shell_qml
anchors.fill: parent
Component.onCompleted: { console.log(ipy_shell_qml + " initialized") }