Skip to content

Commit 84c68ec

Browse files
[Hotfix] [FXC-6639] fix(): sync SUPPORTED_GEOMETRY_FILE_PATTERNS with WebUI accepted extensions (#1927) (#1928)
Co-authored-by: Mike Park <mike@flexcompute.com>
1 parent a94887d commit 84c68ec

2 files changed

Lines changed: 61 additions & 12 deletions

File tree

flow360/component/utils.py

Lines changed: 60 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,82 @@
2626
from ..exceptions import Flow360RuntimeError, Flow360TypeError, Flow360ValueError
2727
from ..log import log
2828

29+
# Keep in sync with GeometryAcceptItems in the WebUI:
30+
# flex/frontend/flow360-ui-next/src/pages/workbench/components/
31+
# resource-management-panel/components/resource-upload-panel/index.tsx
2932
SUPPORTED_GEOMETRY_FILE_PATTERNS = [
33+
# ESP / EGADS
3034
".csm",
3135
".egads",
36+
# STEP
37+
".stp",
38+
".step",
39+
".stpz",
40+
# IGES
41+
".iges",
42+
".igs",
43+
# ACIS
3244
".sat",
3345
".sab",
3446
".asat",
3547
".asab",
48+
# AutoCAD-3D
49+
".dwg",
50+
".dxf",
51+
# Autodesk Inventor
52+
".ipt",
3653
".iam",
54+
# CATIA V4
55+
".model",
56+
".session",
57+
".dlv",
58+
".exp",
59+
# CATIA V5
60+
".catdrawing",
3761
".catpart",
3862
".catproduct",
39-
".gt",
63+
".catshape",
64+
".cgr",
65+
# CATIA V6 / 3DExperience
66+
".3dxml",
67+
# Creo-Pro/E
68+
".asm",
69+
".asm.*",
4070
".prt",
4171
".prt.*",
42-
".asm.*",
43-
".par",
44-
".asm",
45-
".psm",
46-
".sldprt",
47-
".sldasm",
48-
".stp",
49-
".step",
72+
".neu",
73+
".xas",
74+
".xpr",
75+
# I-deas
76+
".mf1",
77+
".arc",
78+
".unv",
79+
".pkg",
80+
# IFC
81+
".ifc",
82+
".ifczip",
83+
# Parasolid
84+
".x_b",
5085
".x_t",
86+
".xmt",
5187
".xmt_txt",
52-
".x_b",
5388
".xmt_bin",
89+
# Revit
90+
".rvt",
91+
".rfa",
92+
# Rhino 3D
5493
".3dm",
55-
".ipt",
94+
# Solid Edge
95+
".par",
96+
".pwd",
97+
".psm",
98+
# SolidWorks
99+
".sldasm",
100+
".sldprt",
101+
# VDA-FS
102+
".vda",
103+
# Granite (PTC internal kernel)
104+
".gt",
56105
]
57106

58107

tests/simulation/asset/test_geometry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def test_draft_geometry_from_file():
5252
with pytest.raises(
5353
ex.Flow360FileError,
5454
match=re.escape(
55-
"The given file: file.unsupported is not a supported geometry or surface mesh file. Allowed file suffixes are: ['.csm', '.egads', '.sat', '.sab', '.asat', '.asab', '.iam', '.catpart', '.catproduct', '.gt', '.prt', '.prt.*', '.asm.*', '.par', '.asm', '.psm', '.sldprt', '.sldasm', '.stp', '.step', '.x_t', '.xmt_txt', '.x_b', '.xmt_bin', '.3dm', '.ipt', '.ugrid', '.cgns', '.stl']"
55+
"The given file: file.unsupported is not a supported geometry or surface mesh file. Allowed file suffixes are: ['.csm', '.egads', '.stp', '.step', '.stpz', '.iges', '.igs', '.sat', '.sab', '.asat', '.asab', '.dwg', '.dxf', '.ipt', '.iam', '.model', '.session', '.dlv', '.exp', '.catdrawing', '.catpart', '.catproduct', '.catshape', '.cgr', '.3dxml', '.asm', '.asm.*', '.prt', '.prt.*', '.neu', '.xas', '.xpr', '.mf1', '.arc', '.unv', '.pkg', '.ifc', '.ifczip', '.x_b', '.x_t', '.xmt', '.xmt_txt', '.xmt_bin', '.rvt', '.rfa', '.3dm', '.par', '.pwd', '.psm', '.sldasm', '.sldprt', '.vda', '.gt', '.ugrid', '.cgns', '.stl']"
5656
),
5757
):
5858
sm = Geometry.from_file("file.unsupported")

0 commit comments

Comments
 (0)