Skip to content

Instantly share code, notes, and snippets.

import Rhino
import scriptcontext
import System.Guid
#import System.Drawing
import math
from matrix import Matrix
def Torus(R, r, toroidal, poloidal):
"""Returns a parametrically constructs a torus mesh."""
mesh = Rhino.Geometry.Mesh()
@patmo141
patmo141 / ModelUndercutRemoval.py
Created June 19, 2017 03:00
Slicer Scripted Module for Undercut Removal
from __main__ import vtk, qt, ctk, slicer
import os
import math
class ModelUndercutRemoval:
def __init__(self, parent):
parent.title = "Model Undercut Removal"
parent.categories = ["Examples"]
class INDEFPHYS_physics_scene(bpy.types.Operator):
'''Take selected objects into a separate scene for physics simulation'''
bl_idname = "indefphys.add_physics_scene"
bl_label = "Physics Scene for Simulation"
bl_options = {'REGISTER','UNDO'}
@classmethod
def poll(self,context):
if context.scene.name == "Physics Sim":
return False
import bpy
import bmesh
import math
class D3PLINT_OT_ortho_model_base_former(bpy.types.Operator):
"""Make Ortho Model Base Former"""
bl_idname = "d3splint.ortho_base_former"
import math
import time
import bpy
import bmesh
from mathutils import Vector, Matrix
def dyntopo_remesh(ob, dyntopo_resolution):
#TODO, may try context override!
'''
class OPENDENTAL_OT_limit_movements(bpy.types.Operator):
'''Add constraints to limit movements in simulation'''
bl_idname = "opendental.limit_physics_movements"
bl_label = "Limit Physics Movements"
bl_options = {'REGISTER','UNDO'}
buc_ling = bpy.props.FloatProperty(name = 'Facial/Lingual', default = 2)
mes_dis = bpy.props.FloatProperty(name = 'Mesial/Distal', default = 2)
occlusal = bpy.props.FloatProperty(name = 'Occluso/Gingival', default = 0)
'''
Created on Mar 21, 2019
@author: Patrick
https://stackoverflow.com/questions/2257441/random-string-generation-with-upper-case-letters-and-digits-in-python
'''
import bpy
import bmesh
import math
import bpy
import bmesh
from mathutils import Matrix, Vector, Color
import loops_tools
from mathutils.bvhtree import BVHTree
def bmesh_join_list(list_of_bmeshes, normal_update=False):