-
Notifications
You must be signed in to change notification settings - Fork 17
/
Test1.py
103 lines (93 loc) · 2.37 KB
/
Test1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 28 10:16:22 2015
@author: lvanhulle
"""
from point import Point
from infill import Infill
from outline import Outline
from line import Line
#import arc as a
import math
import numpy as np
import copy
import gcode as gc
import parameters as pr
import constants as c
from infill import Infill
from itertools import islice
import linegroup as lg
import doneshapes as ds
import itertools
from operator import itemgetter
import time
import timeit
import matrixTrans as mt
import random
import bisect
import collections as col
from collections import namedtuple
import sys
import trimesh
from shapely.geometry.polygon import LinearRing, Polygon
from shapely.geometry import *#MultiPolygon
import matplotlib.pyplot as plt
from shapely.ops import cascaded_union
from matplotlib import animation
import inspect
p1 = Point(2.073, 0.0806)
p2 = Point(2.1512, 0.0323)
p3 = Point(2.144081, 0.0389)
p4 = Point(2.0251, 0.1612)
p5 = Point(3,3.0001)
p6 = Point(-1,0)
p7 = Point(4,0)
p8 = Point(4,4)
p9 = Point(0,4)
p10 = Point(3,12)
p11 = Point(0,5)
p12 = Point(0,1)
p13 = Point(0,-1)
p14 = Point(0.0, 0,0)
p15 = Point(8.0, 0.0)
p16 = Point(10.0, 0.0)
p17 = Point(60.326, 19.517)
p18 = Point(61.100, 19.488)
p19 = Point(61.100, 19.512)
p20 = Point(60.326, 19.483)
p21 = Point(50.326152, 9.483299)
p22 = Point(51.550318, 9.528728)
p23 = Point(51.550318, 9.471272)
p24 = Point(50.326152, 9.516701)
#fname = 'C:/Users/lvanhulle/Google Drive/School/Research/Optimize/volFrac0.5 3Directions/Test3Dir.json'
#m1 = ds.multiRegion_oneLayer(fname, 10, 'm')
#
#mg = m1()
#
#next(mg)
#
#g_para = pr.LayerParams(1,2,3,4,5,6,7,8)
#
##mg.send(g_para)
#points = [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11]
#
#lines = [Line(points[i], points[i+1]) for i in range(len(points)-1)]
#
#sq = ds.squareWithHole()
#
path = 'C:\\Users\\lvanhulle\\Google Drive\\School\\Research\\Optimize\\volFrac0.5 pm45\\'
file = 'C-IsoVonMises.STL'
mesh = trimesh.load_mesh(path+file)
""" An example of how to do other infills. """
#currOutline = ds.rect(0,0,15,250)
#filledList = []
#
#for shellNumber in range(pr.numShells):
# filledList.append(currOutline)
# currOutline = currOutline.offset(pr.pathWidth, c.INSIDE)
#
##pattern = lg.LineGroup()
##pattern.addLinesFromCoordinateList([[0,0],[2,2],[4,0]])
#infill = InF.InFill(currOutline, pr.pathWidth, pr.infillAngleDegrees)#, pattern)
#
#filledList.append(infill)