=== PartWork.ai 3D Viewer – CAD, STEP & STL Files ===
Contributors: partworkteam
Tags: 3d viewer, cad, stl, step file, 3d model
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let visitors open STEP, STL, IGES and other CAD files in a free 3D viewer on your site. Nothing for them to install.

== Description ==

**PartWork.ai 3D Viewer** puts an interactive 3D viewer on any page or post. Show your own STEP, STL, IGES, OBJ, BREP or GLB part on a product page, or let visitors drop in their own file and see it in 3D: rotate, zoom, switch views and go fullscreen, on desktop or phone, with nothing to install.

It's built for sites whose customers send CAD files: machine shops, 3D printing services, fabricators, makerspaces and engineering firms. A customer can check their file on your "request a quote" page before they send it, and you can ask for exactly the file you need.

The plugin adds:

* A **PartWork.ai 3D Viewer** block, with a live preview in the editor.
* Show a part of your own: pick a STEP, STL or other model file from the Media Library. The plugin lets the Media Library accept these file types.
* A **[partwork_viewer]** shortcode for the classic editor and page builders.
* Settings for title, light or dark theme, height and colors.

= Free, with a credit link =

The viewer is free on any site. It shows a small "Powered by PartWork.ai" link inside the viewer, which must stay visible. For a viewer without it, ask about a white-label license at support@partwork.ai.

= External services =

This plugin embeds the PartWork.ai viewer, which is hosted by PartWork.ai and loads in an iframe from `cdn.partwork.ai` on pages that contain the block or shortcode. The plugin adds no script to the rest of your site.

What the viewer sends, and when:

* **Every time the viewer loads:** an anonymous usage event (which viewer surface loaded and the origin of the page it is embedded on) is sent to `api.partwork.ai`. The viewer stores a random visitor ID in its own storage on `cdn.partwork.ai` to count repeat views. No cookies are set on your site, and no name, email or account is involved.
* **When a visitor opens a STEP, STL, IGES, OBJ, DXF or BREP file:** the file is uploaded to `api.partwork.ai` to be converted for display. Before the upload, a Cloudflare Turnstile check (`challenges.cloudflare.com`) confirms the visitor is not a bot. GLB files open in the visitor's browser and are not uploaded.
* **When a viewer shows a model you chose:** the model's URL and the address of your page are sent to `api.partwork.ai`, which downloads the file from your site, converts it for display and keeps the converted copy for up to 30 days. It only shows a model on the site that hosts it, and only over https. Visitors' browsers then load the converted copy from PartWork.ai's storage.
* **When a visitor clicks "Modify with AI" or "Open in Studio":** a new tab opens on `studio.partwork.ai`. Nothing is sent before the click. You can hide the button in the block settings or with `ai="off"`.

Links:

* Viewer and documentation: [partwork.ai/embed](https://www.partwork.ai/embed/)
* Embed license: [partwork.ai/viewer-license](https://www.partwork.ai/viewer-license/)
* Terms of service: [partwork.ai/terms-of-service](https://www.partwork.ai/terms-of-service/)
* Privacy policy: [partwork.ai/privacy-policy](https://www.partwork.ai/privacy-policy/)
* Cloudflare Turnstile privacy: [cloudflare.com/turnstile-privacy-policy](https://www.cloudflare.com/turnstile-privacy-policy/)

== Installation ==

1. In your WordPress admin, go to **Plugins → Add New**.
2. Search for "PartWork 3D Viewer", click **Install Now**, then **Activate**.
3. Add the **PartWork.ai 3D Viewer** block to a page, or use the shortcode below.

= Shortcode =

`[partwork_viewer]`

With options:

`[partwork_viewer title="Check your part" theme="light" height="600"]`

Showing your own part:

`[partwork_viewer model="https://yoursite.com/wp-content/uploads/bracket.step" upload="off"]`

= Shortcode attributes =

* `title` — Shown in the viewer header.
* `theme` — `dark` (default) or `light`.
* `height` — Height in pixels, 240 to 1200. Default 520.
* `ai` — `off` hides the "Modify with AI" button.
* `model` — URL of a model file on your site (https). Or `model_id` — its Media Library ID.
* `upload` — `off` stops visitors opening their own files when a model is set.
* `accent`, `model_color`, `background` — Hex colors, e.g. `#e11d48`.

== Frequently Asked Questions ==

= Which files can visitors open? =

STEP (.step, .stp), STL, IGES (.iges, .igs), OBJ, DXF, BREP and GLB. Files up to 75 MB.

= Can I show my own part on a product page? =

Yes. In the block's Model settings, choose a STEP, STL, IGES, OBJ, BREP or GLB file from your Media Library (or paste its URL), or use `model="..."` in the shortcode. Turn off "Let visitors open their own files too" for a view-only product viewer.

The file must be on the same site as the page (a subdomain such as a CDN on your own domain is fine), served over https, and publicly reachable. Visitors can still open DXF files themselves, but a DXF can't be the model you show. The first view converts it, which takes a few seconds; later views are instant. A model on a local or private development site cannot be shown.

On multisite, a network admin also has to add the file extensions (step, stp, stl, iges, igs, obj, brep, brp, glb) under Network Settings → Upload file types.

= Is it really free? =

Yes. Viewing is free for you and your visitors, with no API key and no signup. The only condition is that the "Powered by PartWork.ai" link stays visible.

= Will it slow down my site? =

No. The viewer loads in a lazy-loaded iframe, only on pages that use the block or shortcode, and the 3D engine stays inside the iframe.

= Can I put more than one viewer on a page? =

Yes. Each block or shortcode is its own viewer.

= Where do I get help? =

Email support@partwork.ai.

== Screenshots ==

1. A visitor checking their STEP file on a machine shop's quote page.
2. The block settings: title, theme, height and colors.
3. The viewer on a phone.
4. Show your own part: a product page's viewer with a STEP file picked from the Media Library, view-only.

== Changelog ==

= 1.1.0 =
* Show your own part: choose a model from the Media Library or give its URL (`model`, `model_id`).
* Option to make a viewer view-only (`upload="off"`).
* The Media Library accepts STEP, STL, IGES, OBJ, BREP and GLB files.

= 1.0.0 =
* Initial release: block and shortcode.

== Upgrade Notice ==

= 1.1.0 =
Show your own STEP, STL or other CAD part on any page.

= 1.0.0 =
Initial release.
