尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Convert SolidWorks part files (.SLDPRT) to Parasolid (.x_t) and STEP,
without SolidWorks. View parts, assemblies (.SLDASM) and drawings
(.SLDDRW) in a web page.
Try it online: https://cehaho.github.io/OpenSW/ — your file is not uploaded to any server: it is read and converted in your browser.
openSW shows what the file holds, as SolidWorks stored it. It recomputes nothing: no regeneration, no retessellation, no mass computed from geometry. It is a file reader for interoperability, not a CAD kernel or an API.
| read | not read | |
|---|---|---|
| Part | the exact solid of the saved configuration (Parasolid B-rep → .x_t, STEP), colours, face names | the feature tree (sketches, features, equations, history): what you get is the final solid, not how it was built |
| properties: summary, custom and per-configuration properties, configuration names, material and density, preview image | geometry of configurations that were not saved with their geometry (the page says which ones were) | |
| mass, volume, area, centre of mass and inertia at the centre of mass, when SolidWorks stored them (it does when a property links to them) | mass properties SolidWorks did not store | |
| Assembly | components and a bill of materials by part file (→ CSV), placements, hidden, suppressed and excluded-from-BOM states, the configuration each instance shows, with its part files each part's properties and material in the CSV, mates (name, type, the components they link, a distance's value), the display mesh (→ STL); with its part files, an exact STEP assembly | angle mate values and the faces mates hold; configurations; the exact geometry, which is in the parts |
| Drawing | sheets, lines, arcs, texts (fonts, colours), tables, model view edges, dimensions and their tolerances as drawn (→ SVG, DXF); linked texts ($PRP:"…") with the value they show; dimension values as numbers (lengths, radii, diameters, angles) and length tolerances | the edges a dimension measures; whether a radial dimension is R or Ø other than in its text; angle tolerances; hatches, images, centre marks, the sheet format |
What is not read is counted in the log rather than hidden.
git clone https://github.com/cehaho/OpenSW
cd OpenSW
pip install -e ".[occ]"
Python 3.10+. The occ extra (OpenCASCADE) is only needed for the 3D view of
the web app.
python tools/convert.py part.SLDPRT -o out/ # .x_t and .STEP
python tools/convert.py --help
python tools/webui.py # http://127.0.0.1:8765
Drop a part, download the .x_t or STEP, and view it in 3D: click a face
to read its name, F<node>. The page is in English, with a French option.
Here the file is sent to this local server; uploads are deleted after conversion, results
after 30 minutes. PORT and OPENSW_HOST set the address; on a public
server, put an authenticating reverse proxy in front.
This is the page published at https://cehaho.github.io/OpenSW/. To build it yourself:
python tools/pages.py # writes _site/
_site/ is the same page, served by any static host (GitHub Pages): the
converter runs in the browser under Pyodide, and the
3D view uses occt-import-js
(OpenCASCADE in WebAssembly). The file never leaves the browser: nothing is
uploaded, only the page and its libraries are downloaded. The STEP is
the same as the desktop one except for the last digits (WebAssembly's
sin/cos) and LF line endings.
The web app shows an assembly (.SLDASM) in 3D from the display mesh
SolidWorks stores in it: components, placements, hidden and suppressed
states. Not the exact geometry, which stays in the parts. It downloads as
STL (binary, millimetres, components placed). The file properties list its
components with a count per part file (suppressed and excluded-from-BOM
components left out), and its mates; the component list downloads as CSV.
Dropped with its part files, each CSV line also carries what the part file
says about itself: its material and its custom properties (part number,
description, linked mass…), one column per property name, as the part
writes them.
from sldprt.assembly import read_assembly, to_stl, to_view
asm = read_assembly("assembly.SLDASM")
open("assembly.stl", "wb").write(to_stl(asm))
Drop the assembly together with its part files (several files at once, or a zip) and it downloads as an exact STEP assembly instead: each part written once from its own geometry, each instance placed as the assembly says. Sub-assemblies are flattened; a part that is not supplied is left out and named in the log. Like SolidWorks, it leaves out suppressed and hidden components. On eight test assemblies, every solid has the same volume and centre of mass as in the STEP SolidWorks exports.
from sldprt.load import load_model
from sldprt.step_assembly import write_step_assembly
parts = {name: load_model(name) for name in ("cube.SLDPRT", "cylinder.SLDPRT")}
report = write_step_assembly(read_assembly("assembly.SLDASM"), parts, "assembly.STEP")
print(report.instances, report.missing)
The web app also shows a SolidWorks drawing (.SLDDRW) as SVG, sheet by
sheet: lines, arcs, texts (fonts, sizes, bold, colours, Ø ± ° symbols), table
cells and model views. Click a stroke to read its name. Nothing is
recomputed: the strokes are those SolidWorks wrote in the file. It downloads
as DXF R12 in millimetres (a zip of one DXF per sheet when there are
several), and each sheet as SVG. In the DXF, colours are rounded to the
nearest plain AutoCAD colour and filled arrowheads become outlines.
以上為 README 的開頭部分。其餘內容請閱讀原文。 檢視完整 README ↗