This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def non_linear_parameters_95_percent_confidence_interval(fvec, jac): | |
"""Returns the 95% confidence interval on parameters from | |
non-linear fit results.""" | |
# residual sum of squares | |
rss = np.sum(fvec**2) | |
# number of data points and parameters | |
n, p = jac.shape | |
# the statistical degrees of freedom | |
nmp = n - p | |
# mean residual error |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to format multi-line python code in discord, type: \```py```py | |
def codegoeshere(): | |
print("foobar") | |
```\``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// build123d CodeCAD speedmodeling snippet by Jern | |
// | |
// This was specifically designed for use with TooTallToby's modeling challenges, but applicable for | |
// all CodeCAD modeling, but customize as desired for your own needs. This provides: | |
// 1. A file template that reduces the time necessary to "just start coding/modeling" | |
// 2. Shortcuts like "?ebds + TAB" that creates a BuildSketch + extrude block | |
// | |
// recommended to bind "Snippets: Fill file with Snippet" to e.g. CTRL + ALT + N | |
// recommended to bind "Jupyter: Restart Kernel" to e.g. CTRL + ALT + / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cadquery as cq | |
from random import randrange as rrr | |
from random import seed | |
#Soma set consists of 7 separate pieces | |
# 4 pieces can be x-y plane only, other 3 require x-y-z | |
#keep the same pseudo random colors later: | |
seed(5)#keep colors run-to-run | |
#(3,4,5,77,777,51221,512796321 are good seeds) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cadquery as cq | |
from random import randrange as rrr | |
from random import seed | |
seed(10) #set seed for consistent colors | |
from OCP.BRepPrimAPI import ( | |
BRepPrimAPI_MakePrism, | |
) | |
from OCP.BRepAlgoAPI import ( | |
BRepAlgoAPI_Common, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#CadQuery OCC Hash Testing with Output of New Faces | |
#cq_occ_hash_woutput.py | |
import cadquery as cq | |
from random import randrange as rrr | |
from random import seed | |
seed(10) #set seed for consistent colors | |
from OCP.BRepPrimAPI import ( | |
BRepPrimAPI_MakePrism, | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cadquery as cq | |
from OCP.BRepPrimAPI import ( | |
BRepPrimAPI_MakePrism, | |
) | |
from OCP.BRepAlgoAPI import ( | |
BRepAlgoAPI_Common, | |
BRepAlgoAPI_Fuse, | |
BRepAlgoAPI_Cut, | |
BRepAlgoAPI_BooleanOperation, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cadquery as cq | |
from cadquery import Location, Vector | |
from math import degrees, sin, cos, radians, pi | |
od = 100 | |
dotr = 2 | |
rim = 4 | |
dot_offs = 10 | |
ov_th = 5 | |
dot_ang = 360/12 |