Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
libraries
Commits
9bbfaf2d
Commit
9bbfaf2d
authored
Aug 30, 2021
by
Neil Gershenfeld
Browse files
fixed with roundoff tolerance?
parent
29bf37e5
Changes
3
Hide whitespace changes
Inline
Side-by-side
python/frep-C.py
View file @
9bbfaf2d
...
...
@@ -74,7 +74,6 @@ f"""
#include <png.h>
using namespace std;
int fn(float X,float Y,float Z) {{
cout << Z << ' ' << (Z-(-0.06)) << endl;
return (
{
fn
}
);
}}
int main(int argc, char** argv) {{
...
...
python/pcb.py
View file @
9bbfaf2d
...
...
@@ -172,7 +172,8 @@ def line(x0,y0,x1,y1,z,width):
ny
=
dy
/
l
rx
=
-
ny
ry
=
nx
part
=
"((((X-(x0))*(nx)+(Y-(y0))*(ny)) >= 0) & (((X-(x0))*(nx)+(Y-(y0))*(ny)) <= l) & (((X-(x0))*(rx)+(Y-(y0))*(ry)) >= (-width/2)) & (((X-(x0))*(rx)+(Y-(y0))*(ry)) <= (width/2)) & (Z == z))"
roundoff
=
1e-6
part
=
"((((X-(x0))*(nx)+(Y-(y0))*(ny)) >= 0) & (((X-(x0))*(nx)+(Y-(y0))*(ny)) <= l) & (((X-(x0))*(rx)+(Y-(y0))*(ry)) >= (-width/2)) & (((X-(x0))*(rx)+(Y-(y0))*(ry)) <= (width/2)) & (Z > (z-roundoff)) & (Z < (z+roundoff)))"
part
=
part
.
replace
(
'x0'
,
str
(
x0
))
part
=
part
.
replace
(
'x1'
,
str
(
x1
))
part
=
part
.
replace
(
'y0'
,
str
(
y0
))
...
...
@@ -183,6 +184,7 @@ def line(x0,y0,x1,y1,z,width):
part
=
part
.
replace
(
'ry'
,
str
(
ry
))
part
=
part
.
replace
(
'l'
,
str
(
l
))
part
=
part
.
replace
(
'z'
,
str
(
z
))
part
=
part
.
replace
(
'roundoff'
,
str
(
roundoff
))
part
=
part
.
replace
(
'width'
,
str
(
width
))
return
part
...
...
python/test
deleted
100644 → 0
View file @
29bf37e5
{"function": "(16777215*(((((((3.02-X)-(1))*(0.0)+(Y-(1))*(1.0)) >= 0) & ((((3.02-X)-(1))*(0.0)+(Y-(1))*(1.0)) <= 0.8700000000000001) & ((((3.02-X)-(1))*(-1.0)+(Y-(1))*(0.0)) >= (-0.015/2)) & ((((3.02-X)-(1))*(-1.0)+(Y-(1))*(0.0)) <= (0.015/2)) & (Z == (-0.06))))))", "layers": [-0.06], "xmin": 0.95, "xmax": 2.07, "ymin": 0.95, "ymax": 1.9200000000000002, "mm_per_unit": 25.4, "type": "RGB"}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment