-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstants.py
46 lines (36 loc) · 1.25 KB
/
Constants.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
from random import Random, randint
class ParamNames:
widthOffset = "WidthOffset"
heightOffset = "HeightOffset"
precision = "Precision"
whPrecision = "whPrecision"
seamAbberations = "Seam Abberations"
amount = "Amount"
probability = "Probability"
seed = "Seed"
class Keywords:
layerNumber = "layerNumber"
materialName = "Stitcher Material"
geoNodesName = "Stitcher Geometry Nodes"
importCollectionName = "Import Things"
geoNodesModifierName = "GeoNodes"
viewportOnly = "ViewportOnly"
parent = "parent"
featureType = "type"
zPos = "zPos"
startPoint = "startPoint"
endPoint = "endPoint"
class Types:
externalPerimeter = "External_perimeter"
extruderError = "Extruder_Error"
endPoint = "End_Point"
class BiasedCoin:
def __init__(self, seed=randint(0,500)):
self.randGenerator = Random()
self.randGenerator.seed = seed
def toss(self, headProb):
weights = [100-headProb, headProb]
return self.randGenerator.choices([0,1], weights=weights)[0]
def uniform(self,a,b):
return self.randGenerator.uniform(a,b)
objectProperties = [Keywords.layerNumber, Keywords.parent, Keywords.featureType, Keywords.zPos, Keywords.startPoint, Keywords.endPoint]