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
Jayant Khatkar
tempaware
Commits
2bbe6a66
Commit
2bbe6a66
authored
Aug 21, 2021
by
Jayant Khatkar
Browse files
import contours into julia via json
parent
e0910c8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
2bbe6a66
*.pyc
*.csv
*.gcode
*.json
main.jl
View file @
2bbe6a66
using
DataFrames
using
CSV
using
JSON
voxels
=
DataFrames
.
DataFrame
(
CSV
.
File
(
"tensile-1-1.csv"
))
contours
=
JSON
.
parse
(
open
(
"tensilecontours.json"
))
df
=
DataFrames
.
DataFrame
(
CSV
.
File
(
"tensile-1-1.csv"
))
voxelise.py
View file @
2bbe6a66
...
...
@@ -8,6 +8,7 @@ from math import pi
from
scipy.spatial
import
KDTree
from
scipy.interpolate
import
LinearNDInterpolator
import
pandas
as
pd
import
json
class
Voxelizer
:
...
...
@@ -89,8 +90,16 @@ class Voxelizer:
return
csv_name
def
contour2dict
(
c
):
return
{
'pos'
:
c
.
pos
,
'time'
:
c
.
time
}
if
__name__
==
'__main__'
:
obj
=
'tensile'
pl
=
Voxelizer
(
obj
+
'.vtk'
,
1
,
1
)
#0.25)
contours
=
gc
.
decode_gcode
(
obj
+
'.gcode'
)
#pl = Voxelizer(obj + '.vtk', 1, 1) #0.25
)
#pl.export_voxels('tensile')
contours
=
gc
.
decode_gcode
(
obj
+
'.gcode'
)
outfile
=
open
(
obj
+
'contours.json'
,
'w'
)
json
.
dump
([
contour2dict
(
c
)
for
c
in
contours
],
outfile
)
outfile
.
close
()
Write
Preview
Markdown
is supported
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