# Eidograph Documentation > Official bilingual documentation for Eidograph, a dynamic 2D and 3D geometry application designed for both humans and agents. Eidograph keeps an interactive canvas and readable Eidolang source synchronized. It is distributed as an installed Windows or Android application; there is no user-facing web edition. Projects use only the current `.eido` package format with manifest `version: 2`. The full text of every page below, English and Chinese, is in one file: [llms-full.txt](./llms-full.txt). This file holds the full text of every English and Chinese page listed in https://eidograph-docs.metaphorprojects.link/llms.txt, generated from the page sources at build time. Pages are separated by `---` and each begins with its URL. --- URL: https://eidograph-docs.metaphorprojects.link/en/ # Eidograph — Geometry for humans and agents Draw on 2D and 3D canvases, describe constructions precisely in Eidolang, and edit with an agent. - **Drawing and script stay in sync**: Drags, tools, and parameter changes write back to Eidolang. The script remains the figure's single source of truth. - **2D and 3D**: Keep several plane or solid figures in one project, with consistent Objects, Diagnostics, and Params panels. - **Clear files and exports**: Save a project as a portable .eido package and export figures as SVG, PNG, GIF, or MP4. - **Agent-native integration**: In-app chat and external MCP/REST clients share the same controlled tools and compile path. ## Start here If this is your first visit, follow the [quick start](https://eidograph-docs.metaphorprojects.link/en/guide/getting-started). If you already know the canvas, browse the [Eidolang reference](https://eidograph-docs.metaphorprojects.link/en/eidolang/reference), download an [example project](https://eidograph-docs.metaphorprojects.link/en/examples/), or jump to [agent integration](https://eidograph-docs.metaphorprojects.link/en/agents/integration). AI clients can use [LLMs.txt](https://eidograph-docs.metaphorprojects.link/llms.txt) as the complete documentation index. --- URL: https://eidograph-docs.metaphorprojects.link/en/guide/installation # Install Eidograph Eidograph is distributed for Windows and Android through app stores. Open the official page below, choose the store for your device, and follow the store's installation prompts: **[Go to the official Eidograph download page](https://metaphorprojects.link/eidograph/)** After installation, the store also manages app updates. To uninstall, use **Installed apps** on Windows or the app information screen on Android. On first launch, Eidograph creates a local workspace and opens an example project. Save anything you want to keep long-term as an `.eido` file. Once installed, continue with the [quick start](https://eidograph-docs.metaphorprojects.link/en/guide/getting-started). --- URL: https://eidograph-docs.metaphorprojects.link/en/guide/getting-started # Quick start This page takes you from installation to a first dynamic construction. Eidograph's central idea is simple: every canvas action becomes Eidolang text, so a figure can be saved precisely, reproduced, and edited by an agent. ## Install and launch Open the [official Eidograph download page](https://metaphorprojects.link/eidograph/), continue to the app store for your device, and install Eidograph. On first launch, the app creates an untitled project with one example 2D figure. **Tip** The app is in early development. If a later test build cannot load a previous local workspace, it returns to the default workspace. Save anything you need to keep as an `.eido` file. ## Meet the workspace ![Eidograph workspace showing the canvas, toolbar, figure list, and Eidolang editor](https://eidograph-docs.metaphorprojects.link/images/app-overview-en.png) - Tabs across the top are projects; one `.eido` file represents one project. - The left rail selects and constructs points, segments, circles, and other objects, and contains undo, redo, and export. - The center canvas supports zooming, panning, and direct dragging. - The upper-right panel manages figures in the project. A figure is fixed as 2D or 3D when created. - The lower-right panel switches among **Eidolang**, **Objects**, and **Params**, with diagnostics below. ## Make a first construction 1. Select the **Point** tool and click twice on the canvas to create two free points. 2. Select **Segment**, then click those two points. 3. Return to **Pointer** and drag either point. The segment follows immediately. 4. Open the **Eidolang** panel. You will see a script like this: ```txt space plane point A -3 0 point B 3 0 segment s A B ``` You can paste that script directly as well. Change a coordinate and the canvas recalculates immediately. Orange points are free to drag, purple points are bound to a path, and gray points are derived and move through their inputs. ## Save and reopen Click the project tab and choose **Save**, or press `Ctrl/⌘ K` and run the save command. Eidograph writes one `.eido` file containing every figure in the project and its plain-text script. - Open an `.eido` file to create a new project tab. - Drop a `.txt` or `.geo` file to add one script to the active project. - Choose a file name and location on the first save. Later saves can overwrite that file; use **Save As** to choose a new location. Continue with the [core workflow](https://eidograph-docs.metaphorprojects.link/en/usage/basics) for files, export, settings, and the in-app Agent. Continue with [Install Eidograph](https://eidograph-docs.metaphorprojects.link/en/guide/installation), [Account and Pro](https://eidograph-docs.metaphorprojects.link/en/guide/account-and-pro), or [Tablet touch](https://eidograph-docs.metaphorprojects.link/en/guide/tablet-quick-start). --- URL: https://eidograph-docs.metaphorprojects.link/en/guide/account-and-pro # Account, free limits, and Eidograph Pro An account is optional. Signed out, both 2D/3D dialects, every drawing tool, projects, undo, multi-select, and `.eido` save/open remain available and unmetered. Sign-in synchronizes server-verified Pro entitlement and enables in-app purchasing. ## Sign in with an email code 1. Open **Settings › Account**. 2. Enter your email and choose **Send code**. 3. Read the email, enter the verification code, and choose **Sign in**. 4. The Account page shows the email, Free/Pro status, and current entitlements. There is a 60-second wait before another code can be sent. Access tokens refresh automatically; an invalid session asks you to sign in again. **Sign out** clears the local account session but does not delete project files. ## Daily Free allowances Only three actions that leave the app or use a shared interface are counted per local calendar day: | Feature | Current production/test setting | Charged when | | --- | ---: | --- | | SVG / PNG / GIF / MP4 exports | 5/day | an export succeeds | | In-app Agent messages | 5/day | one user message is sent | | MCP / REST tool calls | 25/day | an external tool actually executes | Allowances reset at local midnight. Tool discovery does not count as an API call. A release can change its limits, so the values shown in **Settings › Account**, the export dialog, and Agent composer are authoritative for the installed build. Reaching a limit never locks geometry or projects. Only that export, message, or external call pauses until the next reset or until the account gains Pro. ## Buy Pro Eidograph Pro is a one-time purchase, not a subscription. After signing in, a build with store billing shows **Buy Eidograph Pro**: - Windows uses a Microsoft Store durable add-on; - Android uses a Google Play one-time product. Store ownership evidence is submitted to the Eidograph Token Server. The client never grants entitlement from a successful store dialog alone; only a verified `pro` entitlement in server account status removes the limits. ## Restore entitlement on another device Install the production build, sign in with the same Eidograph email used for the purchase, then choose **Refresh status** in **Settings › Account**. A server-verified Pro entitlement follows the Eidograph account and does not require buying again on every device. If the store says you own the product but Account still shows Free: 1. Confirm the original Eidograph email is signed in. 2. Confirm Microsoft Store or Google Play uses the store account that owns it. 3. Check the network and choose **Refresh status**. 4. Do not compare entitlement between test and production environments. 5. If it still fails, contact support with app version, platform, purchase time, and order information. ## Offline behavior A successfully fetched account state is cached locally. A temporary network failure does not revoke known Pro access mid-session; the app checks again in the background at most once per day. Initial sign-in, purchase, and recovery of an unlinked entitlement still require a connection. --- URL: https://eidograph-docs.metaphorprojects.link/en/guide/tablet-quick-start # Tablet touch quick start Eidograph uses one pointer-event model for touch, pen, and mouse. On a tablet you can construct, select, multi-select, animate, and save without a keyboard. ## Prepare the layout 1. Use landscape orientation for more canvas and side-panel space. 2. Drag the right-panel splitter to resize it; the inner splitter changes the height of the Figures list. 3. If controls are small, choose L or XL in **Settings › Appearance › Font size**. This scales interface chrome, not the canvas or exports. 4. Fold the right panel when you want to focus on the canvas. ## Core gestures | Gesture | 2D canvas | 3D canvas | | --- | --- | --- | | Single tap | select or place a tool control point | select or place a 3D control point | | Drag a free point | move in the plane and write coordinates | move on a camera-facing plane | | Drag a bound point | move along its path | move on a linear carrier or sphere | | Drag empty space | pan | orbit the camera | | Two-finger pinch/move | zoom about the midpoint and pan | zoom and adjust the view | | Long-press an object | enter touch multi-select | enter touch multi-select | If a second finger lands during drawing or a drag, the one-finger operation is cancelled safely and becomes a two-finger view gesture. ## Draw in one gesture With Segment, Line, Ray, Circle, or another two-point tool, press to place the first point, drag to see the live preview, and release for the second point. Tapping points separately also works. Arc and Ellipse need three control points; follow the previews in order. With **This project › Canvas & zoom › Auto-dock while dragging** enabled: - near a point, coordinates snap while the new point stays free; - near a path, the definition becomes bound and later drags stay on that path; - the candidate highlights before release, so move away to reject it. ## Touch multi-select and bulk edits Hold a canvas object or Objects-panel row still for about half a second. It joins the selection and sticky multi mode starts; later ordinary taps toggle more objects without a modifier key. With two or more selected, the bottom bar offers: - **Copy** and **Paste** to duplicate the selection into this or another figure ([details](https://eidograph-docs.metaphorprojects.link/en/usage/editing-objects#copy-and-paste-objects)); - **Edit…** for shared color, opacity, and visibility; - **Delete** for selected objects and their dependents; - **×** to clear the selection and leave multi mode. Tap empty space or press Escape to clear as well. Multi-select taps never turn into accidental drags. ## Parameters and animation Open **Params** to move the slider for every `param`; release writes the value into the script. The status-bar play, pause, and stop controls run `animate`; Stop writes the current animated values back to text. ## Save your work Choose **Save** from the project tab to write `.eido`. Before testing a new build or uninstalling, use **Save As** and place important files somewhere explicit. Download an [example project](https://eidograph-docs.metaphorprojects.link/en/examples/) to practise dragging and parameters on a tablet. --- URL: https://eidograph-docs.metaphorprojects.link/en/usage/basics # Core workflow ## Projects, figures, and scripts The workspace can keep several projects open. Projects are top-level tabs, and each project may contain any number of 2D plane and 3D solid figures. A figure's kind is fixed when it is created; switching figures mounts the matching canvas and tools. Each figure has one source of truth: its Eidolang script. Canvas tools append commands, dragging rewrites numeric literals, and parameter sliders write their final value back to text. You can freely combine three editing styles: - use tools to assemble a construction quickly; - drag free points or points bound to paths; - edit commands and expressions precisely in the editor. The **Objects** panel lists names, types, freedom tiers, and current status. **Diagnostics** reports errors and warnings with source locations and hints. Fix the earliest error first; later errors are often consequences. ## File management One `.eido` file is one complete project. It is the current ZIP-based format (manifest `version: 2`), with scripts kept as plain UTF-8 text. A saved project includes figure order, names, 2D/3D kinds, and that project's own canvas and zoom settings. Agent chats are excluded by default. Enable **Settings › General › Include agent chats** when you intend to share them. Camera direction, pan/zoom, and selection are local view state and are not stored in the project file. ## Export a figure Choose **Export** at the bottom of the left rail, then select a format and region: | Format | 2D plane | 3D solid | Good for | | --- | --- | --- | --- | | SVG | Native vector output | Wireframe/contour projection from the current view | Publishing, web, and vector editing | | PNG | Transparency and 1×/2×/4× scales | WebGL canvas pixels | Slides, chat, and general images | | GIF | Animation or stage timeline | Timeline or camera orbit | Showing dynamic relationships | | MP4 | Animation or stage timeline | Timeline or camera orbit | Long or high-resolution playback and video editing | The region can be **Current view** or **Fit content**; 2D also supports a custom rectangle drawn on the canvas. Grid, transparency, pixel scale, and animation frame rate can be changed per export or used as saved defaults. ## Useful settings - **Appearance**: light/dark/system theme, interface language, and text scale. - **Canvas & zoom (default)**: seeds future projects only. - **This project › Canvas & zoom**: saved in `.eido` and affects only this project. - **Export defaults**: initial values in the export dialog. - **Agent**: saved model endpoints and the active model. - **MCP / REST server**: native-app port, listening scope, tool permissions, and activity. ## In-app Agent basics 1. Open **Settings › Agent** and add a provider, Base URL, API key, and model ID. 2. Return to the **Agent** tab and ask for something such as “Create a triangle and mark the midpoint of every side.” 3. Expand each tool call to inspect its arguments, result, and script edit. 4. If the result is not useful, choose **Revert turn**. Eidograph attempts to retain manual edits you made afterward. The Agent follows the active project by default. Pin it before a long task so viewing another tab does not change its target. Agent edits use the same compilation, diagnostics, persistence, and undo path as manual edits. **Warning** The model endpoint must allow cross-origin requests from the app's WebView (CORS). The Windows and Android apps store API keys in OS-protected credential storage. Go deeper: [Projects and files](https://eidograph-docs.metaphorprojects.link/en/usage/projects-and-files) · [Object editing](https://eidograph-docs.metaphorprojects.link/en/usage/editing-objects) · [Animation and GIF/MP4](https://eidograph-docs.metaphorprojects.link/en/usage/animation-and-export) · [Using 3D](https://eidograph-docs.metaphorprojects.link/en/usage/solid-3d) · [Settings reference](https://eidograph-docs.metaphorprojects.link/en/usage/settings) --- URL: https://eidograph-docs.metaphorprojects.link/en/usage/projects-and-files # Projects, figures, and files Eidograph is organized as workspace → projects → figures. Every top tab is an open project; one project corresponds to one `.eido` file and can contain any number of 2D or 3D figures. Each figure is one Eidolang script. ## Create a project Choose the framed new-project button in the header, then select: - **New project — 2D figure** for one initial plane figure; - **New project — 3D figure** for one initial solid figure; - **Empty project** to add a figure later from Figures or the Agent. Click tabs to switch. Click the active tab for project actions: rename, save, Save As, or close. After saving, the actual `.eido` file name becomes the project name. ## Manage figures In the **Figures** panel: - use **+ 2D** or **+ 3D** to add a figure; - click a row to switch; - use the pencil to rename; - use the more-actions button to move or copy a figure to another open project; - use × to delete—after confirmation, ordinary undo cannot restore the figure; - the filled/hollow dot controls exposure to Windows MCP/REST clients. Right-click does not open a menu in the Figures list; use the visible row controls. A figure is fixed as `plane` or `solid` at creation. Changing its `space` line to the other kind produces a diagnostic; it does not convert the figure. Create a figure of the intended kind and rewrite the construction instead. While the Agent is pinned to and working in a project, figure add/delete/switch actions are locked so the target cannot change mid-turn. ## Save, Save As, and close - **Save** chooses a path the first time, then overwrites that file. - **Save As** chooses a new name and location and synchronizes the project name to it. - `Ctrl/⌘ S` saves; `Ctrl/⌘ Shift S` uses Save As. - **Close** removes the project tab from the workspace; it does not delete the saved `.eido`. Unsaved work requires confirmation. `.eido` is a ZIP container with current manifest `version: 2`; every figure remains a plain-text script. It stores project name, figure order/names/kinds, and project canvas settings. Agent chat is excluded by default; enable **Settings › General › Include agent chats** when needed. Camera pose, 2D pan/zoom, grid style, and selection are local view state and are not stored in `.eido`. ## Open and drag-drop files Choose the framed **Open a .eido project** folder button or drop a file anywhere on the app: | File | Result | | --- | --- | | `.eido` | opens as a new project tab | | `.zip` | reads the current package structure and opens a new project | | `.geo` / `.txt` | adds one figure to the active project | A bare script uses `space plane` or `space solid`. Without it, Eidograph asks which kind to use. An `.eido` package never merges into the active project. ## Export one script Choose **Save Eidolang (.txt)** in the command palette for the current figure's plain text. It has no other figures or project settings. This is useful for code review and version control; use `.eido` for a complete shareable project. ## Recommended backup routine 1. Save projects regularly. 2. Use **Save As** before an upgrade, track switch, or uninstall. 3. Include Agent chats only when needed, after checking prompts for sensitive content. 4. Reopen the backup in another tab and verify figure count, kinds, and scripts. --- URL: https://eidograph-docs.metaphorprojects.link/en/usage/editing-objects # Object properties, multi-select, undo, and palette Every visual edit in Eidograph is ultimately a script edit. Property changes, drags, bulk edits, and Agent calls all enter the same per-figure undo history. ## Open object properties With Pointer active, clicking or tapping an object selects it and, by default, opens its properties. Two routes always remain available: - right-click an object on Windows; - choose its row in the **Objects** panel. Disable **Settings › General › Click opens properties** if a normal click should select only. Right-click and Objects still open properties. ## Editable properties | Group | Contents | | --- | --- | | Position/value | free coordinates, bound parameter, local coordinates, or `param`; derived objects have no writable DOF | | Appearance | color, opacity, width; 2D also has fill and solid/dashed/dotted line style | | Label | plain text or a complete `$$…$$` LaTeX formula | | Text box | 2D text, width, height, font size, and color | | Visibility | hide/show while keeping the object in Objects | Committing updates or appends `style`, `label`, `hide`, or another ordinary command. Each commit is one undo step. Deleting reports dependent objects and removes the dependency cascade so the script is not left with references to missing names. ## Multi-select - With a keyboard, hold `Ctrl`, `Shift`, or `⌘` and click canvas objects or rows. - With touch/pen, long-press for about half a second to enter sticky multi mode, then tap normally to toggle more. With two or more selected, the bottom bar offers **Edit…** for shared stroke, opacity, and visibility. Delete removes selected objects and dependents. One bulk commit occupies one undo step. Press Escape, click empty canvas, or choose × to clear. `Delete`/`Backspace` deletes the current selection. ## Copy and paste objects Copy a selection — one object or many — into the same figure, another figure, another open project, or another app window: 1. Select the objects (multi-select above). 2. Press `Ctrl/⌘ C`, or choose **Copy** in the bottom selection bar. 3. Switch to the target figure and press `Ctrl/⌘ V`, or choose **Paste** in the bar. Copy takes the selected objects together with everything they are built from (their ancestor points, lines, and macros) plus their styles and labels, so the pasted copy stays live and behaves like the original. Animations and stages are not copied. On paste, any name that already exists in the target figure is renamed (`A` → `A2`); the status bar lists the renames. The paste is one undo step, and the pasted objects become the new selection. A paste is refused when the copy comes from the other dialect (2D into 3D or the reverse) or would add script errors. `Ctrl/⌘ C` puts the copy on the system clipboard as plain Eidolang text, so you can also paste it into the script editor or another app. The bar's **Copy**/**Paste** keep an in-app copy instead, so touch devices need no clipboard permission: with nothing selected, the bar offers **Paste N objects** until you discard it with ×. ## Undo and redo History belongs to the active figure, not the entire project: - `Ctrl/⌘ Z`: undo; - `Ctrl/⌘ Shift Z` or `Ctrl Y`: redo; - the left rail and command palette expose the same actions. Script typing, canvas creation, committed drags, property edits, parameter sliders, Agent calls, and bulk changes are in history. Switching figures switches to that figure's history. Deleting a figure itself is outside script history and cannot be recovered with `Ctrl Z`; save important work first. ## Command palette Press `Ctrl/⌘ K` or click the header `⌘K`. Search for: - drawing tools and their shortcuts; - undo, redo, export, and Save Eidolang; - Save/Save As, Settings, new projects/figures, and Open `.eido`; - every command signature in the active 2D/3D dialect; - a direct Agent request when a model is configured. Choosing a language command inserts its template into the Eidolang editor. Use the [Eidolang reference](https://eidograph-docs.metaphorprojects.link/en/eidolang/reference) for further syntax details. --- URL: https://eidograph-docs.metaphorprojects.link/en/usage/animation-and-export # Parameters, animation, stages, and GIF/MP4 export Animation lives in Eidolang rather than a separate canvas state. 2D, 3D, staged playback, and GIF/MP4 export share one timeline, keeping screen playback aligned with exported frames. ## Parameter sliders ```txt param r 1 range 0.5 4 step 0.1 circle c O radius r ``` Every `param` appears in **Params**. The figure reevaluates while dragging; release writes the value back to the command. Declare `range` for a useful complete slider interval. ## Continuous animation ```txt animate r duration 2s mode pingpong ``` The target must be a parameter or a bound object with writable freedom. Options include: - `mode loop`, `pingpong`, or `once`; - `speed` or `duration`; - `over t0 t1` for a restricted interval. Status-bar Play/Pause controls preview. **Stop** commits current animated values to literals as an undoable edit. ## Staged presentations ```txt stage givens duration 1.2s reveal fade point A -3 0 point B 3 0 segment base A B stage result duration 1.2s reveal draw point M = midpoint(A, B) hide base transition erase duration 0.6s ``` - Objects before the first `stage` are persistent background. - `reveal cut|fade|draw` controls new objects. - `clear` hides earlier stage objects without deleting dependency values. - `show`/`hide` support cut, fade, draw/erase, and their own duration. Staged scripts gain previous, play/pause, reset, next, and a full scrubber. Editing opens at the completed final state; Play from there restarts from stage one. ## Export GIF and MP4 Open **Export** and select GIF or MP4: 1. Choose **Current view** or **Fit content**; 2D also supports a custom rectangle. 2. Decide whether to include the coordinate grid. 3. Choose raster scale, frame rate, and either a preset or custom positive duration. Defaults come from **Settings › Export defaults**. 4. A staged script exports its stage timeline; ordinary `animate` exports one complete motion. 5. 3D additionally offers camera orbit. Both formats render the same frames from the same timeline, so the choice is only about encoding. Duration initially comes from the script timeline, but the export dialog can override it with a preset or custom value. Eidograph caps the total frame count to protect memory and marks a capped export. Lower frame rate, duration, or raster scale to reduce size. ### Choosing between GIF and MP4 | | GIF | MP4 | | --- | --- | --- | | Encoding | palette, up to 256 colors per frame | H.264, full color | | File size | grows quickly with length and detail | much smaller at the same length and scale | | Playback | loops by itself anywhere images display | needs a video player; stays smooth for long or high-resolution clips | | Good for | chat, forums, and issue trackers | slides, video editing, and lecture recordings | Notes that apply to MP4: - The video is silent and never transparent; the export dialog hides the transparent-background switch for both animated formats. - H.264 needs even pixel dimensions, so an odd export width or height is rounded up by one pixel. - Encoding uses the system's H.264 encoder. If the system cannot encode H.264 at the chosen size, the export reports an error and GIF remains available. ## Keep animation robust - Animate a parameter rather than a derived result. - Keep the construction valid across the full range; arc endpoints, for example, must not coincide. - Use moderate `samples` for numeric intersections and surfaces. - Play from start and check Diagnostics before export. - To keep a final pose, Stop to write current values, then save the project. --- URL: https://eidograph-docs.metaphorprojects.link/en/usage/solid-3d # 3D camera, interaction, and solid export The 3D canvas uses a perspective camera and WebGL, but camera motion never changes world coordinates. Orbit, zoom, and reset alter only the view, not Eidolang objects. ## Camera controls - Drag empty canvas to orbit around the current target. - Wheel or pinch to zoom near the pointer. - Pan with a right-drag, or Shift/Ctrl + left-drag; on touch, move two fingers together. The camera and its orbit target move together. - Click the corner orientation axes to open the view menu. **Reset view** restores the origin target and initial distance. With objects selected, **Orbit around selection** also appears: it moves the orbit target to the center of the selection, keeping the viewing direction and distance, so later orbiting turns around those objects. - The inset shows world x/y/z, with z up. Camera position and target persist as local view state when switching figures and return on remount; they are not written to `.eido`. The current project's 3D minimum/maximum distance clamps zoom. ## Select and drag 3D points With Pointer, click objects to select. Picking prioritizes points, then line-like objects, then surfaces/solids, so a point inside a translucent sphere remains reachable. - free `point3` values drag on a camera-facing plane; - bound points move along segment3/line3/ray3; - sphere-bound points move on the sphere; - derived points cannot drag directly. With auto-dock, a free point snaps to a point coordinate or is rebound to a nearby linear carrier or sphere. The candidate highlights before release. ## 3D drawing tools Point3 places a point on world `z = 0`; pressing and dragging vertically creates non-zero z. Segment3, Sphere, Cylinder, Cone, and other tools construct from existing/new control points with dashed or wireframe previews. The **place z** button in the status bar sets the height new points land on: type a value, return to the ground (0), or take the selected point's z. The grid rises to that height while the x/y axes stay at `z = 0`. Expand **Linear objects** and choose **Space line** (`L`), then pick two distinct points. Expand **Planar figures and sections** and choose **Plane**, then pick three non-collinear points. A click where no point exists creates one on the placement plane (the **place z** height, `z = 0` by default) or docked to nearby geometry, written together with the construction; for a point off the ground, create or lift it with Point3 first. Backspace undoes a pick, Escape cancels, and each completed construction is one undo step. Use the created line as an axis for **Revolution**, or the plane as the cutting plane for **Section**. Box, prism, pyramid and pyramid frustum share **Polyhedra**; cylinder, cone and circular frustum share one group; sphere and spherical parts share another. See [constructions](https://eidograph-docs.metaphorprojects.link/en/eidolang/constructions) for all categories and pick orders, or start by modifying a [3D example](https://eidograph-docs.metaphorprojects.link/en/examples/). ## Adaptive grid and sizing Grid step follows camera distance on a 1-2-5 ladder, with the current unit in a corner legend. The ground grid has no edge: it follows the view when you pan and fades out toward the horizon. Infinite lines and planes expand with view distance. Points, intersection markers, and labels remain approximately screen-constant for reliable selection. ## 3D PNG PNG reads the WebGL render: - **Current view** preserves composition; - **Fit content** keeps view direction but temporarily centers and backs away to contain the model; - 1×/2×/4× raster scale is available; - the ground grid and orientation inset can be excluded; - 3D always renders a background and is not transparent. ## 3D SVG 3D SVG is not a canvas screenshot. Eidograph regenerates a wireframe/contour projection from the evaluated model and camera: lines and curves become projected polylines, solids output edges and analytic silhouettes, and surfaces output iso-grid lines with translucent fills. There is currently no hidden-line removal. Approximate depth ordering means complex overlap may differ from the solid WebGL image. SVG is suited to illustration and vector layout, not engineering projection. ## 3D GIF and MP4 GIF and MP4 can use the script `animate`/`stage` timeline or automatic camera orbit. **Fit content** creates a temporary export camera without changing the saved interactive camera. Both formats render the same frames; MP4 keeps the file far smaller for the same orbit. Lower frame rate, raster scale, duration, or surface samples if rendering is too large or slow. --- URL: https://eidograph-docs.metaphorprojects.link/en/usage/settings # Complete settings reference Settings are divided into **App** preferences and **This project** settings. App preferences affect the workspace and stay on this device; project settings travel in `.eido`. Do not confuse “Canvas & zoom (default)” with the current project's “Canvas & zoom.” ## App › General - **Include agent chats** adds project sessions to saved `.eido`; off by default. Review prompts and attachments before sharing. - **Click opens properties** controls whether a canvas click opens the popover. When off, click selects only; right-click and Objects still open it. - **Reset all preferences** resets appearance, export, Agent, server, and new-project canvas defaults. It does not change open projects' geometry or own canvas settings. ## App › Appearance - **Color theme**: dark, light, or system. - **Language**: system or a supported UI locale. Eidolang keywords are never translated. - **Font size**: S/M/L/XL (about 85%–130%) for header, tools, panels, and dialogs only—not canvas or export size. ## App › Canvas & zoom (default) Copied once when a **new project** is created: - 2D min/max scale and target grid spacing in pixels; - 3D min/max camera distance and grid density; - auto-dock while dragging. Changing defaults never modifies an existing project. Use the This project page for that. ## App › MCP / REST server Native external-interface settings in the Windows app: - server on/off and port (default `14159`); - loopback-only or same-LAN clients; - MCP address and copied Trae/WorkBuddy config; - independent allow-list for each tool; - up to 200 recent external calls. LAN mode has no authentication and must be used only on a trusted network. Figure exposure is controlled separately by the dot in Figures. See [Agent integration](https://eidograph-docs.metaphorprojects.link/en/agents/integration). ## App › Account Email-code sign-in, Free/Pro state, today's allowances, refresh, sign-out, and platform store purchase. See [Account, free limits, and Pro](https://eidograph-docs.metaphorprojects.link/en/guide/account-and-pro). ## App › Agent - show/hide the in-app Agent tab; - save several models and choose the active one; - providers: OpenAI-compatible, Anthropic, Google Gemini/Vertex; - name, Base URL, API key, and model ID per model; - fetch model IDs from the endpoint or enter one manually. Windows and Android store API keys in protected system credential storage; non-sensitive model metadata remains in preferences. Deleting a model also deletes its key. ## App › Export defaults - PNG, GIF, and MP4 scale: 1×, 2×, or 4×; - default transparent background for 2D SVG/PNG; - Animation frame rate (GIF and MP4): 5–50 fps. These seed the export dialog and can be overridden per export. Animation duration (GIF and MP4) starts from the script timeline and can be replaced with a preset or custom positive duration in the export dialog. Coordinate-grid inclusion also has a saved default and remains adjustable. ## This project › Canvas & zoom The same 2D/3D limits, grid values, and auto-dock, but owned by this project and written to the `.eido` manifest: - 2D limits and auto-dock apply immediately; - 3D distance limits apply after reopening/switching the figure; - **Reset this project** copies current App defaults without affecting other projects. ## About Shows app version, project website, and support email. A useful report includes version, platform, test/production environment, reproduction steps, and a share-safe `.eido` when relevant. ## What travels with a project | Content | In `.eido` | Local only | | --- | --- | --- | | Project canvas/zoom and auto-dock | yes | — | | Figure scripts, names, and kinds | yes | — | | Agent chats | optional | local by default | | Theme, language, and font size | no | yes | | Export defaults and Agent models | no | yes | | API keys and account session | no | yes (secure/session storage) | | Camera pose, pan/zoom, selection | no | yes (view state) | | MCP/REST port, tool allow-list, figure exposure | no | yes | --- URL: https://eidograph-docs.metaphorprojects.link/en/components/overview # Drawing components An Eidograph “component” is an Eidolang construction object. Objects refer to one another by name, and changing an upstream object recalculates every derived object through the dependency graph. ## Free, bound, and derived Every object belongs to one freedom tier: | Tier | Example | Interaction | | --- | --- | --- | | Free (orange) | `point A 0 0` | Drag directly; coordinates are written back | | Bound (purple) | `point P on c at 0.25` | Drag only along its carrier; the parameter is written back | | Derived (gray) | `point M = midpoint(A, B)` | Cannot be dragged; move its inputs instead | The same rule applies in 2D and 3D, and it is the first thing to check when a point does not drag. ## Plane components ### Points and linear objects ```txt space plane point A -3 -1 point B 3 -1 segment base A B point M = base.mid perpendicular p M base ``` Common linear objects include `segment`, `line`, `ray`, `vector`, parallels, and perpendiculars. A point may be free or bound to a segment, circle, curve, or another path. ### Circles, arcs, ellipses, and polygons ```txt circle c M through A point P on c at 45deg arc a A P B polygon tri A P B label P text "P" ``` Each result is a first-class object that later commands can reference. Circles, ellipses, and polygons can become regions for union, intersection, and difference; any paths can be intersected. ### Functions and motion `plot`, `curve`, `polar`, `equation`, and `locus` produce paths. `param` supplies an adjustable value, `animate` varies a parameter or bound object over time, and `stage` organizes a sequential presentation. ```txt param r 2 range 0.5 4 circle c M radius r animate r duration 2s mode alternate ``` ## Solid components A 3D figure starts with `space solid`. Its primitives include `point3`, `segment3`, `vector3`, planes, spheres, circles, boxes, prisms, pyramids, cylinders, and cones, plus spatial curves, loci, frames, and function surfaces. ```txt space solid point3 O 0 0 0 point3 T 0 0 3 sphere s O radius 2 cylinder body O T radius 1 ``` Use the Pointer tool to orbit the camera. Selected objects still expose type, status, and editable properties in the Objects panel. A 3D SVG is a regenerated wireframe/contour projection from the current view, not a screenshot of the WebGL canvas. ## Style, labels, and groups `style` controls color, width, opacity, fill, and 2D dash style. `label` adds text or a complete `$$…$$` LaTeX formula. `textbox` adds wrapped content on a 2D canvas. `group` lets several objects share hide, show, and style operations. The properties popover is a visual editor for these commands. Whether changed there or in the source editor, the result is an ordinary text edit that can be undone and read by an agent. --- URL: https://eidograph-docs.metaphorprojects.link/en/eidolang/reference # Eidolang language reference Eidolang is the text representation of an Eidograph figure. A figure is one script: commands create objects, expressions establish dependencies, and style and animation remain in the same text. Dragging, canvas tools, and property changes ultimately write back to this script. This page describes only the current language, Eidolang `0.2`; it contains no retired syntax. For complete runnable scripts, visit [example projects](https://eidograph-docs.metaphorprojects.link/en/examples/). ## Script skeleton Every script should begin with a space declaration: ```txt space plane version 0.2 # One command per line; # starts a comment point A -2 0 point B 2 0 segment base A B point M = midpoint(A, B) ``` - `space plane` selects the 2D dialect; `space solid` selects the 3D dialect. - `version 0.2` is optional. It is the language version, not the `.eido` manifest version. - Names are case-sensitive and must be defined before use. - Bare angle literals are radians; write degree values explicitly, such as `45deg`. - Strings use double quotes. Colors may use forms such as `#3366cc`. ## Freedom model Every geometry object belongs to exactly one tier: | Tier | Definition | Behavior | | --- | --- | --- | | Free | Coordinates or values are literal | Drag directly or edit in the properties panel | | Bound | Uses `on … at …` or local coordinates against a carrier | Moves only on its carrier | | Derived | Uses an `=` expression based on other objects | Cannot be dragged; updates when inputs change | ```txt point A 0 0 # free point P on c at 0.25 # bound point M = midpoint(A, P) # derived ``` ## Shared values and expressions Scalar expressions support `+ - * / ^`, parentheses, comparisons, and boolean operations. Constants include `pi`, `tau`, and `e`; common functions include `sin`, `cos`, `tan`, `sqrt`, `abs`, `min`, `max`, and distance/vector functions. Object properties can feed later expressions, such as `base.length`, `c.radius`, and `poly.area`. `let` stores any expression value, while `fn` defines a function for plots or surfaces: ```txt let half = base.length / 2 fn wave(x) = sin(x) * half plot graph wave domain -6 6 ``` Invalid values do not crash the app. Diagnostics report the source location and reason, while downstream objects become invalid or warning records. ## Plane (2D) commands ### Construct basic objects | Component | Common forms | | --- | --- | | Point | `point A x y`, `point P on path at t`, `point M = expr` | | Linear | `segment s A B`, `line l A B`, `ray r A B`, `vector v A B` | | Circle | `circle c O radius r`, `circle c O through A` | | Ellipse and arc | `ellipse e F1 F2 through P`, `arc a P1 P2 P3` | | Polygon | `polygon tri A B C` | | Standard constructions | `midpoint M A B`, `parallel p A l`, `perpendicular p A l` | | Intersections | `intersections xs pathA pathB` | Intersection results are `list`. Prefer stable selectors such as `xs.nearest(A)`, `xs.maxY`, or `xs.minX`; the order behind `xs[0]` may change during motion. ### Paths, functions, and regions ```txt plot graph sin domain -6 6 curve loop (cos(t), sin(t)) t from 0 to tau samples 160 polar rose (2*cos(3*a)) a from 0 to tau equation unit x^2 + y^2 = 1 locus trace P driver u samples 180 region disk = c region lens = intersection(c1, c2) ``` Segments, lines, rays, circles, ellipses, arcs, function plots, and loci implement Path behavior. They can carry bound points, intersect one another, and be composed with `subpath` and `pathjoin`. ### Transforms and frames ```txt point Q = reflect(P, axis) rotate tri2 tri around O by 30deg translate c2 c by (2, -1) scale big tri around O by 2 frame f O X point L in f 1 0.5 ``` `reflect`, `rotate`, `translate`, and `scale` are available both as expression functions and commands. Similarity transforms preserve object types where possible. ## Solid (3D) commands ```txt space solid point3 O 0 0 0 point3 T 0 0 3 sphere ball O radius 2 cylinder body O T radius 1 ``` | Component | Common forms | | --- | --- | | Points and lines | `point3`, `segment3`, `line3`, `ray3`, `vector3` | | Planes and spheres | `plane ground A B C`, `sphere s O radius r` | | Solids | `box`, `prism`, `pyramid`, `cylinder`, `cone` | | Frames | `frame3 f O X Y`, `point3 P in f x y z` | | Space curves | `curve3`, `locus3` | | Function surfaces | `surface waves f domain x0 x1 y0 y1` | | Intersections | `intersections3`, `plane_intersect_line`, `sphere_intersect_sphere` | | Transforms | `reflect3`, `rotate3`, `translate3`, `scale3` | In 3D, a point can bind to a segment, line, ray, or sphere surface. A sphere point uses two parameters: ```txt point3 P on ball atAngles 45deg 90deg ``` `box`, `prism`, `pyramid`, `cylinder`, and `cone` expose measures such as `.volume`, `.surfaceArea`, and `.centroid`. `curve3` and `locus3` are sampled display objects and are not currently carriers for bound points. ## Parameters, animation, and stages ```txt param r 1 range 0.5 4 step 0.1 circle c O radius r animate r duration 2s mode pingpong stage result duration 1.2s reveal draw show c transition draw duration 0.8s ``` - `param` creates a slider in the Params panel. - `animate` supports `loop`, `pingpong`, and `once`. - `stage` creates sequential presentation steps; `show`, `hide`, `clear`, and reveal modes control presence. - 2D playback, 3D playback, and GIF/MP4 export share the same timeline. ## Presentation commands ```txt style base stroke #3366cc width 2 opacity 0.9 label base text "given segment" textbox note -4 3 width 5 height 2 text "Drag A or B" group helpers A B base hide helpers transition fade duration 0.5s ``` `style` controls color, fill, width, opacity, and point/arrow sizes; 2D also supports dash patterns. Label text wrapped completely in `$$…$$` is rendered as LaTeX. `textbox` is 2D-only. ## Macros and assertions ```txt def bisect(A, B) -> (M, b) { midpoint M A B perpendicular_bisector b A B } use bisect P Q -> M1 b1 assert dist(P, M1) == dist(M1, Q) tolerance 1e-6 note "M1 is midpoint" ``` `def`/`use` reuse a construction and isolate its internal names during expansion. `assert` checks a relationship and produces a warning; it does not constrain or solve the figure. ## Query exact signatures in the app This page organizes commonly used commands by purpose. For exact, complete signatures from the installed version: - use **help** in the Eidolang editor; - ask the in-app Agent to call `list_commands`; - call the same tool from an external MCP/REST client. The returned list comes directly from the active dialect's parser registry, so it stays aligned with the installed build. ## Additional objects See [additional constructions](https://eidograph-docs.metaphorprojects.link/en/eidolang/constructions.md) for tangents, conics, Bézier/splines, inequality regions, space Paths, faces, sections, generated solids, and parametric/implicit surfaces. --- URL: https://eidograph-docs.metaphorprojects.link/en/eidolang/constructions # Additional Eidolang constructions These commands are part of the current language in both the App and Viewer. They do not change the `.eido` manifest or persisted workspace format. Use `space plane` or `space solid` in separate figures. All constructions below are derived; move their defining points or animate a `param` to change them. Names such as `e`, `sphere`, and `surface` are reserved. ## Toolbox Expand a group in the left toolbox and choose a tool, then pick objects on the canvas or in the Objects list in the prompted order. The command palette activates the same tools. Picks are highlighted; wrong types are ignored. When the step asks for a point, a click where no point exists creates one, with the same snapping as the drawing tools: an existing point nearby is reused, a click on or near a curve makes a point bound to it, and anywhere else makes a free point (in 3D, docked to a nearby object or on the placement plane — `z = 0` unless the status bar's **place z** says otherwise). New points appear right away but are written to the script only together with the construction. When the step asks for anything else, an empty click creates nothing. Backspace or **Undo last pick** removes the last choice, including a point it created; Escape or **Cancel picks** clears the unfinished construction without editing source. Creation validates geometry, selects the result and records one undo step, new points included. Measurements and projections remain expressions referencing the picked objects, so moving the inputs updates the result. Tools share categories by geometry and purpose. Group tooltips show the category, and each group remembers its last-used tool. The rail and command palette use the same tool table; existing keyboard shortcuts remain available. | Space | Category | Tools | | --- | --- | --- | | 2D | Points and centers | Point, incenter, circumcenter, orthocenter, centroid | | 2D | Linear objects | Segment, vector, line, ray | | 2D | Auxiliary lines | Perpendicular, parallel, tangent, normal, tangents from a point, angle bisector | | 2D | Circles and arcs | Circle, arc, circumcircle, incircle | | 2D | Conics | Ellipse, parabola, hyperbola | | 2D | Curves | Bézier, spline | | 2D | Polygons and regions | Regular polygon, sector, circular segment, inequality | | 3D | Linear objects | Segment3, vector3, line3 | | 3D | Space circles and curves | Circle3, arc3, ellipse3 | | 3D | Planar figures and sections | Plane, polygon3, section | | 3D | Polyhedra | Box, prism, pyramid, polyhedron, pyramid frustum | | 3D | Cylinders, cones and frustums | Cylinder, cone, circular frustum | | 3D | Spheres and spherical parts | Sphere, cap, hemisphere, zone, sector | | 3D | Generated geometry | Extrude, revolve | | 3D | Mathematical surfaces | Parametric surface, implicit surface | Pointer, the 3D point tool, and the 2D text box keep separate rail slots. **Space line** (`L`) takes two distinct existing points and creates `line3`; **Plane** takes three non-collinear existing points. Create or lift points with Point3 first when needed. The resulting line can be a revolution axis, and the plane can be a cutting plane for Section. Both retain references to their input points and use the validated picking flow described above. | Tool | Pick order | | --- | --- | | Tangent / normal | Curve, point (projected onto the curve) | | Tangents from a point | Circle, external point | | Angle bisector | Point, vertex, point; then choose internal/external | | Triangle circles / centers | Three triangle vertices | | Parabola | Focus, directrix line, segment, or ray | | Hyperbola | Focus 1, focus 2, point on the curve | | Bézier / spline | Ordered control points; Enter or **Finish** completes the list (Bézier also completes at four points) | | Regular polygon | Center, vertex; then set the number of sides | | Sector / circular segment | Center, start radius point, end direction point (counterclockwise) | | Space line / plane | Two distinct points / three non-collinear points | | circle3 / arc3 | Three points; the middle arc point lies on the arc | | ellipse3 | Center, major-axis endpoint, minor-axis measuring point; the third point defines the plane and its perpendicular distance defines the second radius | | polygon3 / polyhedron | Ordered vertices / polygon faces; Enter, **Finish**, or pick the first object again to finish | | Section | Solid, cutting plane | | Circular frustum | Base center, base radius point, top center, top radius point | | Pyramid frustum | Base polygon, top center, top radius point (relative to the base's first vertex) | | Extrude | Profile, vector or segment defining the extrusion displacement | | Revolve | Profile, axis line (full revolution) | | Spherical pieces | Sphere, normal vector / segment / line / ray / plane; cap and sector then take a cutting-plane point, zone takes two; hemisphere needs no cut point | | Inequality / equation3 / parametric surface | Two domain corners, then the mathematical expression | Variable-length lists require at least three points for a polygon or Bézier, two for a spline, and four faces for a polyhedron. Spline completion offers a closed/open option. Domain bounds use the picked points' x/y coordinates (and z for equation3); x/y correspond to u/v for a parametric surface. ## Plane constructions ```txt circumcircle cc A B C incircle ic A B C angle_bisector bis A V B angle_bisector ext A V B external point I = incenter(A, B, C) point O = circumcenter(A, B, C) point H = orthocenter(A, B, C) point G = centroid(A, B, C) tangent tanLine path at 0.5 normal normalLine path at 0.5 tangents candidates circleName from P let chosen = candidates.first parabola par F directrix directrixLine from -10 to 10 hyperbola hyp F1 F2 through P from -3 to 3 bezier quadratic A B C bezier cubic A B C D regular_polygon hex O V sides 6 spline route A B C D spline loop A B C D closed sector wedge O radius 2 from 0 to 90deg circular_segment cap O radius 2 from 0 to 90deg inequality disk (x^2 + y^2 <= r^2) domain -4 4 -4 4 ``` - `circumcircle` and `incircle` return ordinary circles. The four triangle-center functions return points; all reject degenerate triangles. - `angle_bisector` uses `V` as the vertex. `external` chooses the external line. A zero-length ray or an undefined bisector is invalid. - `tangent` and `normal` return lines at the carrier's native parameter, using the same parameter as `point ... on ... at`. A zero tangent is invalid. - `tangents` returns a **list of lines**, also rendered together. There are two exterior tangents, one at a point on the circle, and no tangents for an interior point (empty list and warning). Select a line before using it as a carrier. - A parabola's native parameter is signed distance along the direction obtained by rotating its focus-facing axis counterclockwise 90°. Its vertex is halfway between the focus and its perpendicular foot on the directrix. With focal length `p`, the axial coordinate is `t²/(4p)`. `from`/`to` default to `-10 10`. The directrix may be a line, segment, or ray; a segment or ray stands for the whole line through it, which is what `.directrix` returns. Properties: `.focus`, `.vertex`, `.axis`, `.directrix`, `.focalLength`, `.length`. - A hyperbola is defined by the absolute focal-distance difference through `P`. `from`/`to` bound the hyperbolic parameter (default `-3 3`) on **each** branch: `x = ±a cosh(u)`, `y = b sinh(u)` in its local axes. The combined path uses part-index + fraction: `[0,1)` is the left branch, `[1,2]` the right branch. There is a jump at `1`, never a drawn connector. `.left` and `.right` are Paths with native parameter `u` and include both endpoints. Prefer them for a smooth animation confined to one branch. Properties: `.center`, `.f1`, `.f2`, `.a`, `.b`, `.vertex1`, `.vertex2`, `.asymptote1`, `.asymptote2`, `.length`. - Bézier accepts three or four control points; native parameter is `[0,1]`. Properties: `.degree`, `.controls`, `.length`. - `regular_polygon` returns a polygon with integer `sides` in `[3,1000]`. - `spline` is a uniform Catmull–Rom interpolating spline. Open ends duplicate the endpoint control; `closed` uses periodic controls. Native parameter is control interval index + fraction, `[0,n-1]` open or `[0,n)` closed. Consecutive duplicate controls are invalid. Properties: `.controls`, `.length`. - `sector` and `circular_segment` return Regions with exact `.area`, sampled boundary loops, `.contains(P)`, and an `.arc` Path. They compose with existing region boolean operations. Angles follow the existing counterclockwise arc convention. The circular segment is the cap bounded by the arc and its chord, and can be larger than a semicircle. - `inequality` takes a boolean expression in local `x,y` and clips it to its required rectangular domain. Undefined samples are excluded. `.area` and boundaries are numerical, like other Regions. Compose several conditions with `intersection`, `union`, or `difference`. Domain expressions reference ordinary script objects even if they are named `x` or `y`. All new plane Paths support `.point(t)`, `.project(P)`, `.param(P)`, `.tangent(t)`, point binding, intersections, similarity transforms, and animation. Numeric intersections and path lengths use fixed samples and are approximate. ## Space curves and faces ```txt circle3 orbit O normal (0,0,1) radius 2 circle3 throughThree A B C arc3 arc O normal (0,0,1) radius 2 from 0 to 90deg arc3 throughArc A B C ellipse3 ellipse O normal (0,0,1) radii 3 2 angle 30deg ellipse3 oriented O normal (cross3(vec3(O,A),vec3(O,B))) axis (vec3(O,A)) radii 3 2 polygon3 face A B C D polygon3 ring outerFace holes holeFace point3 P on orbit at 30deg point3 Q on helix at 0.5 let nearest = helix.project(A) let t = helix.param(A) let direction = helix.tangent(0.5) animate Q duration 4s mode pingpong ``` `ellipse3` accepts `axis ` instead of `angle` to orient its first axis; the vector is projected into the supporting plane and must remain nonzero. Using both clauses is invalid. Space Paths are `segment3`, `ray3`, `line3`, `circle3`, `arc3`, `ellipse3`, `polygon3` boundaries, `curve3`, and `locus3`. They all provide `point(t)`, `project(P)`, `param(P)`, `tangent(t)` (unit vector), and `.length`. A bound point with a literal `at` can be dragged, animated, and written back without losing comments or angle units. Open bounded carriers clamp `at` to their endpoints; circles and ellipses are periodic. Unbounded carriers require animation `over`. Sphere surface binding continues to use `atAngles` and two parameters. Native parameters: | Carrier | Parameter | | --- | --- | | segment3 | fraction `[0,1]` | | ray3 / line3 | distance / signed distance, as before | | circle3 / ellipse3 | angle / eccentric angle `[0,2pi)` | | arc3 | angle `[from,to]` | | polygon3 boundary | edge index + fraction; loop edges concatenate with gaps between loops | | curve3 | the declared parameter and its `from`/`to` domain | | locus3 | the driver's value and range | The default planar basis projects world +x into the plane; near a normal parallel to +x it projects +y instead. Its second axis is `normal × firstAxis`. Three-point arcs start at `A`, pass through `B`, and end at `C`. `curve3` retains its exact expression evaluator; `locus3` interpolates sampled continuous pieces. Projection is numerical. Undefined parameter gaps remain invalid rather than being bridged. At a corner, polygon boundary tangents use the outgoing edge. `circle3` properties: `.center`, `.normal`, `.radius`, `.area`, `.length`. `arc3`/`ellipse3` also expose `.rx`, `.ry`, `.f1`, `.f2`, and `.angle` (sweep). `ellipse3.area` is exact; arc `.area` refers to the supporting ellipse, not a sector. A `polygon3` must be simple, finite, and coplanar. It can be concave. `holes` combines an outer face with an inner face's loops; boundaries must be disjoint. Hole/island nesting uses even–odd fill. Properties: `.area`, `.centroid`, `.normal`, `.count`, `.vertices`, `.perimeter`, `.length`; method `.contains(P)` also checks that `P` is in the supporting plane. Triangulation respects holes. ## Solids, sections, and generated surfaces ```txt polyhedron custom face1 face2 face3 face4 section cut custom by cuttingPlane section ballCut ball by cuttingPlane frustum round baseCenter topCenter radii 2 1 pyramid_frustum truncated baseFace top topCenter scale 0.5 extrude extrusion ring by (0,0,3) extrude roundExtrusion orbit by (0,0,3) samples 96 revolve revolvedFace profileFace around axis samples 64 revolve revolvedCurve profileCurve around axis from 0 to 180deg samples 64 parametric_surface torus ((3+cos(v))*cos(u),(3+cos(v))*sin(u),sin(v)) domain 0 2pi 0 2pi samples 48 let surfacePoint = torus.point(0,0) let surfaceNormal = torus.normal(0,0) equation3 quadric (x^2+y^2+z^2-4) domain -3 3 -3 3 -3 3 samples 32 ``` - `polyhedron` takes at least four polygon faces. Shared vertices are matched geometrically. Every edge must belong to two faces; the boundary must be connected and consistently orientable. Input faces must define a simple, non-self-intersecting solid. Winding is corrected before volume integration. `.volume`, `.surfaceArea`, `.centroid`, `.count`, `.vertices`, `.faces`, `.edges` are available. Face and edge lists can feed subsequent constructions. - `section` intersects a solid with a plane. Polyhedral cuts produce a `polygon3` with one or more loops, including holes. Coplanar faces are handled; cuts with no area (empty, vertex, or edge contact) return an empty list and warning. A sphere cut is an exact `circle3`. Cylinder, cone, and round-frustum cuts use sampled polygon boundaries; polyhedron/box/prism/pyramid cuts use their actual planar faces. Section boundary points can be bound and animated normally. - `frustum` is a circular frustum. Its measures are exact; displayed round boundaries are sampled. `.height`, `.radius1`, `.radius2` supplement solid measures. `pyramid_frustum` translates/scales a simple polygon about its centroid to a top center outside its plane; positive `scale` defines the top similarity. - `extrude` accepts `polygon3` (including holes), `circle3`, or `ellipse3`. Its direction must leave the profile plane. Polygon measures are exact; circular/elliptic profiles are sampled (default 96, clamped to `[8,256]`). - `revolve` accepts a bounded space Path or a simple `polygon3`. A Path produces an open surface; a polygon produces a closed solid. The axis must lie in the polygon's plane, and the generating region must stay on one side of the axis. Defaults: full turn, 64 samples; partial turns receive closing caps. Holes in generating polygons are rejected. Mesh measures are numerical. Revolution is limited to 30,000 generated vertices. - `parametric_surface` binds local `u,v` inside the coordinate triple. Domain bounds are ordinary scalar expressions. Samples default to 48 and clamp to `[8,160]` intervals per axis. Undefined cells stay open. `.point(u,v)` evaluates the expression exactly; `.normal(u,v)` uses numerical partial derivatives. `.surfaceArea` is a triangle estimate. Point binding uses curves, not surface UV. - `equation3` takes a scalar field and draws its **zero set** in a required box; write `lhs-rhs` to express an equation. Marching tetrahedra share a deterministic cube subdivision. Samples default to 32 and clamp to `[8,64]` per axis. Undefined cells stay open; an empty result warns. `.surfaceArea` is a triangle estimate; it is a surface, not a volumetric solid. Mesh generation stops at 250,000 vertices. Generated faces/surfaces render in WebGL and export to SVG. Similarities transform curves, faces, generated meshes, and their measurements. As with existing objects, changes flow through source dependencies, and geometry never depends on viewport. Region/surface sampling is charged to the evaluation budget; the Viewer may refuse high sample counts sooner than the editor. ## Spherical solids ```txt sphere_cap cap ball normal (0,0,1) height 1 samples 32 hemisphere half ball normal (0,0,1) samples 32 sphere_zone band ball normal (0,0,1) from -1 to 1 samples 32 sphere_sector radial ball normal (0,0,1) height 1 samples 32 ``` The source is a `sphere`; `normal` defines its positive axis. Cap height is in `(0,2r]`; hemisphere uses height `r`. A zone is the solid slice between two signed axial offsets, `-r <= from < to <= r`. A spherical sector joins the cap's spherical surface to the sphere center along radial segments. These solids reuse meridian revolution for sampled display, while `.volume`, total `.surfaceArea`, `.centroid`, `.height`, and spherical `.curvedArea` use exact formulas. A cap's total area includes its closing disk; a zone includes both disks; a sector includes its conical boundary. Samples default to 32 and clamp to `[8,96]`. Similarities preserve exact measures. --- URL: https://eidograph-docs.metaphorprojects.link/en/examples/objects-2d # 2D object gallery Each topic is a separate project with complete, editable Eidolang source. Previews are rendered from that same source by the actual runtime and show its initial state; open a project to explore it. In Eidograph, use **Open** or drop in a downloaded file, then drag free points, change parameters and use **Save As** to keep your own version. **View in Viewer** opens it in a browser for viewing and playback; edit it in the installed app. Also explore the [3D object gallery](https://eidograph-docs.metaphorprojects.link/en/examples/objects-3d), [basic examples](https://eidograph-docs.metaphorprojects.link/en/examples/) and [animations](https://eidograph-docs.metaphorprojects.link/en/examples/animations). ## Points and linear objects Compare free points A and B, bound point P, derived midpoint M, segments, lines, rays, vectors, parallels and perpendiculars. Drag A or B to update the construction. ![Points and linear objects](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-lines.png) [Download 2d-lines.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-lines.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-lines.eido) **Full Eidolang source** ```txt space plane # Free, bound and derived points; four kinds of linear objects. point A -3 -1 point B 1 1 segment base A B point P on base at 0.35 midpoint M A B line axis (-3,3) (1,3) ray beam (-3,-3) (1,-2) vector arrow (2,-1) (4,1) parallel offset (0,2) base perpendicular upright B base style offset stroke #8b949e dash 6 4 style upright stroke #8b949e dash 6 4 label base text "segment" label axis text "line" label beam text "ray" label arrow text "vector" ``` ## Triangle circles and centers One triangle shows its circumcircle, incircle, incenter, circumcenter, orthocenter, centroid and internal angle bisector. Drag the vertices to compare how the centers move. ![Triangle circles and centers](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-triangle.png) [Download 2d-triangle.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-triangle.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-triangle.eido) **Full Eidolang source** ```txt space plane # Drag A, B or C to update circles, centers and the angle bisector. point A -3 -2 point B 3 -2 point C -1 3 polygon triangle A B C circumcircle outer A B C incircle inner A B C point I = incenter(A,B,C) point O = circumcenter(A,B,C) point H = orthocenter(A,B,C) point G = centroid(A,B,C) angle_bisector bis B A C style triangle fill #4c8dff opacity 0.2 style outer stroke #8b949e dash 6 4 style inner stroke #3fb68b width 2 style bis stroke #d9a53f label I text "incenter" label O text "circumcenter" label H text "orthocenter" label G text "centroid" ``` ## Circles, arcs and conics Compare a circle, a three-point arc, a focal ellipse, a focus/directrix parabola and a hyperbola, with a tangent and normal to the circle. Gray dashed lines identify the normal. ![Circles, arcs and conics](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-conics.png) [Download 2d-conics.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-conics.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-conics.eido) **Full Eidolang source** ```txt space plane circle round (-5,2) radius 1.3 arc bow (-6,-2) (-5,-1) (-4,-2) ellipse oval (-1,2) (1,2) through (0,2.7) point F 4 2 line directrix (3,0) (5,0) parabola bowl F directrix directrix from -2 to 2 hyperbola branches (-1,-3) (1,-3) through (0.6,-3) from -1.3 to 1.3 tangent touch round at 45deg normal radial round at 45deg style touch stroke #d9a53f style radial stroke #8b949e dash 6 4 label round text "circle" label bow text "arc" label oval text "ellipse" label bowl text "parabola" label branches text "hyperbola" ``` ## Bezier curves and interpolating splines Four control points define a cubic Bezier, with gray endpoint handles. The lower spline interpolates its points; a closed spline sits in the middle. Drag A, B, C, D or bound point P to explore the curves, tangent and normal. ![Bezier curves and interpolating splines](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-smooth-curves.png) [Download 2d-smooth-curves.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-smooth-curves.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-smooth-curves.eido) **Full Eidolang source** ```txt space plane point A -4 1 point B -2 4 point C 1 -1 point D 4 2 bezier cubic A B C D segment handleA A B segment handleB C D spline interpolated (-4,-2) (-2,-1) (0,-3) (2,-1) (4,-2) spline closedLoop (-1,1) (0,2.5) (1,1) (0,0) closed point P on cubic at 0.5 tangent touch cubic at 0.5 normal radial cubic at 0.5 style handleA stroke #8b949e dash 6 4 style handleB stroke #8b949e dash 6 4 style interpolated stroke #3fb68b width 2 style closedLoop stroke #b58cf2 width 2 style touch stroke #e0447c style radial stroke #8b949e dash 6 4 label cubic text "Bezier" label interpolated text "spline" label closedLoop text "closed spline" ``` ## Polygons and filled regions A regular hexagon, triangle, sector, circular segment, intersection of two disks and inequality region show different ways to construct filled geometry. The inequality is sampled within its domain. ![Polygons and filled regions](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-regions.png) [Download 2d-regions.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-regions.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-regions.eido) **Full Eidolang source** ```txt space plane # Domain corners also keep the sampled regions inside the initial fitted view. point domainMin 2.5 -3.5 point domainMax 5.5 3.5 hide domainMin hide domainMax regular_polygon hex (-4,2) (-2.5,2) sides 6 polygon tri (0,1) (2,1) (1,3) sector wedge (4,1.5) radius 1.6 from 0 to 120deg circular_segment cap (-4,-2) radius 1.6 from 0 to 140deg circle leftDisk (-0.6,-2) radius 1.3 circle rightDisk (0.6,-2) radius 1.3 region lens = intersection(leftDisk,rightDisk) inequality patch ((x-4)^2+(y+2)^2 <= 1.8) domain 2.5 5.5 -3.5 -0.5 style hex fill #d9a53f opacity 0.65 style tri fill #4c8dff opacity 0.6 style wedge fill #3fb68b opacity 0.6 style cap fill #e0447c opacity 0.6 style lens fill #b58cf2 opacity 0.8 style patch fill #5bbcbf opacity 0.7 label hex text "regular polygon" label wedge text "sector" label cap text "circular segment" label lens text "intersection" label patch text "inequality" ``` ## Function, parametric, polar and implicit curves Compare a function plot, a Lissajous parametric curve, a polar rose and an implicit ellipse. Change parameter a to adjust the sine amplitude. See [functions and equations](https://eidograph-docs.metaphorprojects.link/en/examples/functions) for more animated examples. ![Function, parametric, polar and implicit curves](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-plots.png) [Download 2d-plots.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-plots.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-plots.eido) **Full Eidolang source** ```txt space plane param a 1 range 0.5 1.5 fn wave(x) = a*sin(x)+2.5 plot graph wave domain -5 5 curve loop (-3+1.4*cos(t),-1+sin(2*t)) t from 0 to 2pi samples 120 polar rose (1.5*cos(3*t)) t from 0 to 2pi samples 180 equation oval (x-3)^2/2+(y+1)^2 = 1 domain 1 5 -3 1 label graph text "plot" label loop text "parametric curve" label rose text "polar curve" label oval text "implicit equation" ``` ## Subpaths, joined paths and loci The red subpath highlights part of a circle, the lower green pathjoin connects two segments, and the purple locus traces Q. Change u to move P and Q together. ![Subpaths, joined paths and loci](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-paths.png) [Download 2d-paths.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-paths.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-paths.eido) **Full Eidolang source** ```txt space plane param u 0.7 range 0 2pi circle carrier (-2,0) radius 2 subpath highlight carrier from 20deg to 140deg point P on carrier at u point Q = translate(P,(4,0)) locus trail Q driver u samples 100 segment link P Q segment first (-4,-3) (0,-3) segment second (0,-3) (2,-2) pathjoin route first second hide first hide second style carrier stroke #8b949e dash 6 4 style highlight stroke #e0447c width 4 style trail stroke #b58cf2 width 2 style route stroke #3fb68b width 3 label highlight text "subpath" label trail text "locus" label route text "pathjoin" ``` ## Frames, transforms and annotations A local frame drives the blue triangle, its rotated, translated and scaled copies, a right-angle mark, matching ticks, labels and a textbox. Drag X to change the frame direction and scale. ![Frames, transforms and annotations](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-frames-and-labels.png) [Download 2d-frames-and-labels.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-frames-and-labels.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-frames-and-labels.eido) **Full Eidolang source** ```txt space plane point O -3 -1 point X -1 -1 frame local O X point A in local 0 0 point B in local 1 0 point C in local 1 1 polygon original A B C rotate turned original around O by 60deg translate shifted original by (5,0) scale enlarged original around O by 1.6 mark right A B C segment lower A B segment side B C mark tick lower mark tick side label shifted text "translate" hide A hide B textbox note -4 4 width 8 height 1.5 text "Drag X to change the local frame. Marks and labels follow the geometry." style original stroke #4c8dff fill #4c8dff opacity 0.65 style turned stroke #3fb68b fill #3fb68b opacity 0.4 style shifted stroke #e0447c fill #e0447c opacity 0.4 style enlarged stroke #d9a53f opacity 0.5 ``` --- URL: https://eidograph-docs.metaphorprojects.link/en/examples/objects-3d # 3D object gallery Each topic is a separate project with complete, editable Eidolang source. Previews are rendered from that same source by the actual runtime and show its initial state; open a project to explore it. In Eidograph, use **Open** or drop in a downloaded file, then drag free points, change parameters and use **Save As** to keep your own version. **View in Viewer** opens it in a browser for viewing and playback; edit it in the installed app. Also explore the [2D object gallery](https://eidograph-docs.metaphorprojects.link/en/examples/objects-2d), [basic examples](https://eidograph-docs.metaphorprojects.link/en/examples/) and [animations](https://eidograph-docs.metaphorprojects.link/en/examples/animations). For examples containing infinite lines or planes, choose **Reset view** in the Viewer, then orbit or zoom to inspect the finite objects. ## Spatial points, lines, planes and frames Combines point3, segment3, line3, ray3, vector3, a three-point plane, a spatial triangle and a frame3-bound point. Orbit the camera to inspect their positions. ![Spatial points, lines, planes and frames](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-lines-and-planes.png) [Download 3d-lines-and-planes.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-lines-and-planes.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-lines-and-planes.eido) **Full Eidolang source** ```txt space solid point3 O -2 -1 0 point3 X 0 -1 0 point3 Y -2 1 0 frame3 local O X Y point3 P in local 0.5 0.5 1 segment3 leg O P vector3 arrow (1,-1,0) (2,0,2) line3 axis (-3,2,0) (1,2,1) ray3 beam (1,1,0) (2,1,1) plane sheet O X Y polygon3 triangle (1,-2,0) (3,-2,0) (2,-2,2) style sheet stroke #4c8dff fill #4c8dff opacity 0.12 style triangle stroke #3fb68b fill #3fb68b opacity 0.55 label P text "frame point" label leg text "segment3" label arrow text "vector3" label axis text "line3" label beam text "ray3" ``` ## Spatial circles, ellipses and curves The front row compares circles, arcs and ellipses with different normals; behind them sit a helix and spatial locus. P is bound to the helix. Change u to move Q along the purple trace. ![Spatial circles, ellipses and curves](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-space-curves.png) [Download 3d-space-curves.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-space-curves.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-space-curves.eido) **Full Eidolang source** ```txt space solid circle3 orbit (-3,0,1) normal (0,0,1) radius 1.4 arc3 bow (0,0,1) normal (0,1,0) radius 1.4 from 0 to 140deg ellipse3 oval (3,0,1) normal (0,1,1) radii 1.6 0.8 curve3 helix (1.2*cos(t),4+1.2*sin(t),t/3) t from 0 to 4pi samples 120 point3 P on helix at 2pi param u 1 range 0 2pi point3 Q = (-3+cos(u),4+sin(u),1+0.5*sin(2*u)) locus3 trail Q driver u samples 100 style helix stroke #e0447c width 2 style trail stroke #b58cf2 width 2 label orbit text "circle3" label bow text "arc3" label oval text "ellipse3" label helix text "curve3" label trail text "locus3" ``` ## Polyhedra Compare a box, triangular prism, square pyramid, pyramid frustum and a custom tetrahedron assembled from four triangular faces. Supporting faces are hidden to keep the solids clear. ![Polyhedra](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-polyhedra.png) [Download 3d-polyhedra.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-polyhedra.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-polyhedra.eido) **Full Eidolang source** ```txt space solid box block (-5,-2,0) dims 2 2 2 prism wedge (-1,-2,0) (1,-2,0) (0,0,0) extrude (0,0,2) pyramid peak (3,-2,0) (5,-2,0) (5,0,0) (3,0,0) apex (4,-1,2.5) polygon3 base (-5,3,0) (-3,3,0) (-3,5,0) (-5,5,0) pyramid_frustum truncated base top (-4,4,2) scale 0.5 hide base polygon3 faceA (-1,3,0) (1,3,0) (0,5,0) polygon3 faceB (-1,3,0) (0,4,2) (1,3,0) polygon3 faceC (1,3,0) (0,4,2) (0,5,0) polygon3 faceD (0,5,0) (0,4,2) (-1,3,0) polyhedron tetra faceA faceB faceC faceD hide faceA hide faceB hide faceC hide faceD style block stroke #4c8dff fill #4c8dff opacity 0.45 style wedge stroke #3fb68b fill #3fb68b opacity 0.45 style peak stroke #e0447c fill #e0447c opacity 0.45 style truncated stroke #d9a53f fill #d9a53f opacity 0.5 style tetra stroke #b58cf2 fill #b58cf2 opacity 0.5 label block text "box" label wedge text "prism" label peak text "pyramid" label truncated text "pyramid frustum" label tetra text "polyhedron" ``` ## Cylinders, cones and frusta Three solids share height parameter h while keeping their radii fixed. Change h to compare a cylinder, cone and circular frustum, then orbit to inspect caps and sides. ![Cylinders, cones and frusta](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-round-solids.png) [Download 3d-round-solids.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-round-solids.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-round-solids.eido) **Full Eidolang source** ```txt space solid param h 2.5 range 1.5 3.5 cylinder tube (-4,0,0) (-4,0,h) radius 1 cone peak (0,0,0) apex (0,0,h) radius 1.3 frustum taper (4,0,0) (4,0,h) radii 1.3 0.65 style tube stroke #4c8dff fill #4c8dff opacity 0.55 style peak stroke #3fb68b fill #3fb68b opacity 0.55 style taper stroke #e0447c fill #e0447c opacity 0.55 label tube text "cylinder" label peak text "cone" label taper text "frustum" ``` ## Spheres and spherical parts From left to right: sphere, spherical cap, hemisphere, spherical zone and spherical sector. Hidden reference spheres have the same radius, making it easy to compare planar caps, spherical patches and the sector cone. ![Spheres and spherical parts](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-sphere-parts.png) [Download 3d-sphere-parts.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-sphere-parts.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-sphere-parts.eido) **Full Eidolang source** ```txt space solid sphere ball (-6,0,1.2) radius 1.2 sphere capSource (-3,0,1.2) radius 1.2 sphere halfSource (0,0,1.2) radius 1.2 sphere bandSource (3,0,1.2) radius 1.2 sphere radialSource (6,0,1.2) radius 1.2 sphere_cap cap capSource normal (0,0,1) height 0.8 samples 16 hemisphere half halfSource normal (0,0,1) samples 16 sphere_zone band bandSource normal (0,0,1) from -0.5 to 0.5 samples 16 sphere_sector radial radialSource normal (0,0,1) height 0.8 samples 16 hide capSource hide halfSource hide bandSource hide radialSource style ball stroke #4c8dff fill #4c8dff opacity 0.55 style cap stroke #3fb68b fill #3fb68b opacity 0.6 style half stroke #e0447c fill #e0447c opacity 0.6 style band stroke #d9a53f fill #d9a53f opacity 0.6 style radial stroke #b58cf2 fill #b58cf2 opacity 0.6 label ball text "sphere" label cap text "cap" label half text "hemisphere" label band text "zone" label radial text "sector" ``` ## Extrusion and sections with holes Extrude a polygon with a square hole upward. The pink section preserves the hole. Change h to move the cutting plane through the solid, or edit the extrusion vector in the source. ![Extrusion and sections with holes](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-extrusion-and-section.png) [Download 3d-extrusion-and-section.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-extrusion-and-section.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-extrusion-and-section.eido) **Full Eidolang source** ```txt space solid param h 1.5 range 0.5 2.5 polygon3 outer (-2,-2,0) (2,-2,0) (2,2,0) (-2,2,0) polygon3 hole (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) polygon3 ring outer holes hole extrude hollow ring by (0,0,3) plane slicing (0,0,h) normal (0,0,1) section cut hollow by slicing hide outer hide hole hide ring style hollow stroke #4c8dff fill #4c8dff opacity 0.25 style slicing stroke #d9a53f fill #d9a53f opacity 0.1 style cut stroke #e0447c fill #e0447c opacity 0.8 label cut text "section with a hole" ``` ## Revolved surfaces and partial solids On the left, a segment revolves through a full turn to make a surface. On the right, a closed polygon revolves through 270 degrees to make a capped solid. The yellow segment and visible axes explain the construction. ![Revolved surfaces and partial solids](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-revolution.png) [Download 3d-revolution.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-revolution.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-revolution.eido) **Full Eidolang source** ```txt space solid line3 axis (-3,0,0) (-3,0,1) segment3 profile (-1.7,0,0) (-2.2,0,3) revolve skin profile around axis samples 24 polygon3 panel (2.5,0,0) (4,0,0) (3.5,0,2.5) (2.5,0,2.5) line3 secondAxis (2,0,0) (2,0,1) revolve body panel around secondAxis from 0 to 270deg samples 24 hide panel style skin stroke #3fb68b fill #3fb68b opacity 0.5 style body stroke #e0447c fill #e0447c opacity 0.5 style profile stroke #d9a53f width 3 label skin text "revolved curve" label body text "partial revolved solid" ``` ## Function, parametric and implicit surfaces From left to right: a two-variable function surface, a parametric torus and an implicit ellipsoid. Change a to adjust the wave amplitude. Moderate sampling keeps all three usable in the Viewer. ![Function, parametric and implicit surfaces](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-surfaces.png) [Download 3d-surfaces.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-surfaces.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-surfaces.eido) **Full Eidolang source** ```txt space solid param a 0.7 range 0.3 1.2 fn wave(x,y) = a*(sin(x+5)+cos(y))+1.5 surface graph wave domain -7 -3 -2 2 samples 12 parametric_surface torus ((1+0.35*cos(v))*cos(u),(1+0.35*cos(v))*sin(u),1.5+0.35*sin(v)) domain 0 2pi 0 2pi samples 12 equation3 ellipsoid ((x-5)^2/2+y^2+(z-1.5)^2-1) domain 3 7 -1.5 1.5 0 3 samples 12 style graph stroke #4c8dff fill #4c8dff opacity 0.55 style torus stroke #3fb68b fill #3fb68b opacity 0.55 style ellipsoid stroke #e0447c fill #e0447c opacity 0.55 label graph text "function surface" label torus text "parametric surface" label ellipsoid text "implicit surface" ``` --- URL: https://eidograph-docs.metaphorprojects.link/en/examples/ # Basic [2D object gallery](https://eidograph-docs.metaphorprojects.link/en/examples/objects-2d) · [3D object gallery](https://eidograph-docs.metaphorprojects.link/en/examples/objects-3d) Download any project below and open it directly in Eidograph. Every download uses the current `.eido` format (manifest `version: 2`) and contains editable Eidolang source. No retired format or migration data is included. After downloading, choose **Open** in the app header and select the file. You can also drop an `.eido` file onto the app; it opens as a new project tab. You do not have to install anything: every example also has a **View in Viewer** link that opens the project in the browser-based viewer. ## Square and midpoint construction (2D) Two free points drive a construction that remains a true square, followed by midpoints, a rotated point, segments, right/equal marks, and live assertions. It is a compact introduction to free and derived points, transforms, and `assert`. ```txt space plane point A -2 2 point B -2 -1 point C = rotate(A, B, -90deg) point D = translate(A, vec(B, C)) polygon square A B C D ``` [Download square-abcd-midpoint-pq.eido](https://eidograph-docs.metaphorprojects.link/downloads/square-abcd-midpoint-pq.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/square-abcd-midpoint-pq.eido) ## Solid component tour (3D) Combines a cylinder and helix, a cone, a similarity frame, and a parameter-driven spatial locus in one project. Use it for a quick look at common 3D objects and animation. ```txt space solid point3 G 3 -3 0 point3 H 3 -3 2 cylinder tube G H radius 0.6 curve3 helix (3 + 0.8*cos(5*t), -3 + 0.8*sin(5*t), t) t from 0 to 2 samples 200 ``` [Download solids-tour.eido](https://eidograph-docs.metaphorprojects.link/downloads/solids-tour.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/solids-tour.eido) ## Stella octangula (3D) Two regular tetrahedra interpenetrate to form a stella octangula. One parameter controls the whole scale, while the script constructs a circumsphere, the core octahedron, and an orbiting sphere point, with assertions that continuously check the geometry. ```txt space solid param s 1.4 range 0.6 2.4 point3 O 0 0 0 point3 A1 s s s point3 A2 s -s -s point3 A3 -s s -s point3 A4 -s -s s pyramid alpha A1 A2 A3 apex A4 ``` [Download stella-octangula.eido](https://eidograph-docs.metaphorprojects.link/downloads/stella-octangula.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/stella-octangula.eido) ## Sine and cosine function surface (3D) Uses a two-variable function and `surface` to draw `z = sin(x) + cos(y)`. A parameter slider changes the amplitude live. This demonstrates `fn`, sampled function surfaces, parameters, and style. ```txt space solid param s 1 range 0.2 2.5 fn f(x, y) = s * (sin(x) + cos(y)) surface waves f domain -6 6 -6 6 samples 64 ``` [Download surface-sincos.eido](https://eidograph-docs.metaphorprojects.link/downloads/surface-sincos.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/surface-sincos.eido) ## Modify an example After opening an example, drag free points, move parameter sliders, or edit literals in the Eidolang editor. Use **Save As** to keep your own copy. Read the [Eidolang language reference](https://eidograph-docs.metaphorprojects.link/en/eidolang/reference) when you want to understand a command from first principles. --- URL: https://eidograph-docs.metaphorprojects.link/en/examples/animations # Animations Each example below is a standalone `.eido` project holding a single figure that uses `stage`, `animate` and `assert` to demonstrate one geometric result. Every download uses the current `.eido` format (manifest `version: 2`) and contains editable Eidolang source. After downloading, choose **Open** in the app header and select the file, or drop the `.eido` file onto the app. You do not have to install anything: the **View in Viewer** link plays the project in the browser. The image in each section is a PNG exported from the same figure with Eidograph's export tool and shows one frame of the timeline. Open the file to play the whole animation. ## Plane figures ### Perpendicular Bisector Theorem This example shows how to make an animation to demo the perpendicular bisector theorem. P slides along the perpendicular bisector of AB while the live length labels on PA and PB stay equal, and two assertions check the distances and the right angle on every frame. ![Perpendicular Bisector Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/perpendicular-bisector-theorem.png) [Download perpendicular-bisector-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-bisector-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-bisector-theorem.eido) ### Napoleon's Theorem This example shows how to make an animation to demo Napoleon's theorem. Vertex C keeps deforming the triangle while the three equilateral-triangle centers stay the vertices of an equilateral triangle. ![Napoleon's Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/napoleons-theorem.png) [Download napoleons-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/napoleons-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/napoleons-theorem.eido) ### Thales' Theorem This example shows how to make an animation to demo Thales' theorem. P travels along the semicircle while the angle subtended at P by the diameter AB stays a right angle. ![Thales' Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/thales-theorem.png) [Download thales-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/thales-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/thales-theorem.eido) ### Inscribed Angle Theorem This example shows how to make an animation to demo the inscribed angle theorem. P moves around the major arc while the central angle AOB stays exactly twice the inscribed angle APB. ![Inscribed Angle Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/inscribed-angle-theorem.png) [Download inscribed-angle-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/inscribed-angle-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/inscribed-angle-theorem.eido) ### Perpendicular Chord Bisector Theorem This example shows how to make an animation to demo the perpendicular chord bisector theorem. The chord AB rotates around the circle while OM stays perpendicular to it and the two half-chord labels stay equal. ![Perpendicular Chord Bisector Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/perpendicular-chord-bisector-theorem.png) [Download perpendicular-chord-bisector-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-chord-bisector-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-chord-bisector-theorem.eido) ### Isosceles Triangle Base Angles This example shows how to make an animation to demo the base angles of an isosceles triangle. Apex C slides up and down the axis of symmetry, and the two base angles stay equal at every height. ![Isosceles Triangle Base Angles](https://eidograph-docs.metaphorprojects.link/images/examples/animations/isosceles-triangle-base-angles.png) [Download isosceles-triangle-base-angles.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/isosceles-triangle-base-angles.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/isosceles-triangle-base-angles.eido) ### Triangle Angle Sum This example shows how to make an animation to demo the angle sum of a triangle. A parallel drawn through C folds the three interior angles into a straight angle while vertex C keeps moving. ![Triangle Angle Sum](https://eidograph-docs.metaphorprojects.link/images/examples/animations/triangle-angle-sum.png) [Download triangle-angle-sum.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-angle-sum.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-angle-sum.eido) ### Triangle Centroid Theorem This example shows how to make an animation to demo the centroid theorem. The triangle deforms while the three medians keep meeting at G, which stays at a 2:1 ratio along every median. ![Triangle Centroid Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/triangle-centroid-theorem.png) [Download triangle-centroid-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-centroid-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-centroid-theorem.eido) ### Pythagorean Rearrangement Proof This example shows how to make an animation to demo the Pythagorean theorem. Four congruent right triangles rotate into a second arrangement inside the same square, turning the two smaller squares into one square on the hypotenuse. ![Pythagorean Rearrangement Proof](https://eidograph-docs.metaphorprojects.link/images/examples/animations/pythagorean-rearrangement-proof.png) [Download pythagorean-rearrangement-proof.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/pythagorean-rearrangement-proof.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/pythagorean-rearrangement-proof.eido) ### Triangle Circumcenter This example shows how to make an animation to demo the circumcenter of a triangle. The three perpendicular bisectors keep meeting at O, and the circumcircle follows the moving vertex C. ![Triangle Circumcenter](https://eidograph-docs.metaphorprojects.link/images/examples/animations/triangle-circumcenter.png) [Download triangle-circumcenter.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-circumcenter.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-circumcenter.eido) ### Radius and Tangent This example shows how to make an animation to demo the right angle between a radius and a tangent. The point of contact T travels around the circle while the tangent line stays perpendicular to the radius OT. ![Radius and Tangent](https://eidograph-docs.metaphorprojects.link/images/examples/animations/radius-and-tangent.png) [Download radius-and-tangent.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/radius-and-tangent.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/radius-and-tangent.eido) ### Power of a Point This example shows how to make an animation to demo the power of a point. One secant through P rotates while the live labels show that both secant products stay equal. ![Power of a Point](https://eidograph-docs.metaphorprojects.link/images/examples/animations/power-of-a-point.png) [Download power-of-a-point.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/power-of-a-point.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/power-of-a-point.eido) ### Ptolemy's Theorem This example shows how to make an animation to demo Ptolemy's theorem. Vertex D slides around the circle while the product of the diagonals and the sum of the opposite-side products stay equal. ![Ptolemy's Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/ptolemys-theorem.png) [Download ptolemys-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/ptolemys-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/ptolemys-theorem.eido) ### Parallelogram Diagonals This example shows how to make an animation to demo the bisection of the diagonals of a parallelogram. The parallelogram leans as its angle changes, and both diagonals keep the same midpoint M. ![Parallelogram Diagonals](https://eidograph-docs.metaphorprojects.link/images/examples/animations/parallelogram-diagonals.png) [Download parallelogram-diagonals.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/parallelogram-diagonals.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/parallelogram-diagonals.eido) ### Varignon's Theorem This example shows how to make an animation to demo Varignon's theorem. Vertex D keeps deforming the quadrilateral while the quadrilateral of side midpoints stays a parallelogram. ![Varignon's Theorem](https://eidograph-docs.metaphorprojects.link/images/examples/animations/varignons-theorem.png) [Download varignons-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/varignons-theorem.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/varignons-theorem.eido) ### Reflection Shortest Path This example shows how to make an animation to demo the shortest reflected path. P slides along the mirror while the live route length reaches its minimum exactly where A, P and the reflected point B' are collinear. ![Reflection Shortest Path](https://eidograph-docs.metaphorprojects.link/images/examples/animations/reflection-shortest-path.png) [Download reflection-shortest-path.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/reflection-shortest-path.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/reflection-shortest-path.eido) ### Homothety This example shows how to make an animation to demo a homothety. The scale factor k grows while every image point stays on a ray from O and every side length is multiplied by k. ![Homothety](https://eidograph-docs.metaphorprojects.link/images/examples/animations/homothety.png) [Download homothety.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/homothety.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/homothety.eido) ### Rotation Is a Rigid Motion This example shows how to make an animation to demo a rotation as a rigid motion. The triangle turns a full circle around O while assertions check that every side length and angle is preserved. ![Rotation Is a Rigid Motion](https://eidograph-docs.metaphorprojects.link/images/examples/animations/rotation-is-a-rigid-motion.png) [Download rotation-is-a-rigid-motion.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/rotation-is-a-rigid-motion.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/rotation-is-a-rigid-motion.eido) ### Ellipse Focal Definition This example shows how to make an animation to demo the focal definition of an ellipse. P travels once around the ellipse; the two focal distances change but their sum stays constant. ![Ellipse Focal Definition](https://eidograph-docs.metaphorprojects.link/images/examples/animations/ellipse-focal-definition.png) [Download ellipse-focal-definition.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/ellipse-focal-definition.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/ellipse-focal-definition.eido) ### Parabola Focus and Directrix This example shows how to make an animation to demo the focus-directrix definition of a parabola. P moves along the parabola while its distance to the focus stays equal to its distance to the directrix. ![Parabola Focus and Directrix](https://eidograph-docs.metaphorprojects.link/images/examples/animations/parabola-focus-and-directrix.png) [Download parabola-focus-and-directrix.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/parabola-focus-and-directrix.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/parabola-focus-and-directrix.eido) ### Pantograph Similarity This example shows how to make an animation to demo how a pantograph linkage enlarges a drawing. The linkage turns while two loci record the stylus path and the pen path, which stays a similar copy scaled by k. ![Pantograph Similarity](https://eidograph-docs.metaphorprojects.link/images/examples/animations/pantograph-similarity.png) [Download pantograph-similarity.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/pantograph-similarity.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/pantograph-similarity.eido) ### Cycloid from a Rolling Circle This example shows how to make an animation to demo a cycloid. A circle rolls without slipping along a line while a marked point on its rim traces the cycloid as a locus. ![Cycloid from a Rolling Circle](https://eidograph-docs.metaphorprojects.link/images/examples/animations/cycloid-from-a-rolling-circle.png) [Download cycloid-from-a-rolling-circle.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/cycloid-from-a-rolling-circle.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/cycloid-from-a-rolling-circle.eido) ### Unit Circle and Sine Wave This example shows how to make an animation to demo how the unit circle generates a sine wave. A connector links the rotating point on the circle to the point on the graph, whose height is the sine of the same angle. ![Unit Circle and Sine Wave](https://eidograph-docs.metaphorprojects.link/images/examples/animations/unit-circle-and-sine-wave.png) [Download unit-circle-and-sine-wave.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/unit-circle-and-sine-wave.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/unit-circle-and-sine-wave.eido) ### Circle Inversion This example shows how to make an animation to demo inversion in a circle. P moves outward along a ray while its image P' moves inward, keeping the product OP × OP' equal to R². ![Circle Inversion](https://eidograph-docs.metaphorprojects.link/images/examples/animations/circle-inversion.png) [Download circle-inversion.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/circle-inversion.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/circle-inversion.eido) ## Solid figures ### Cuboid Space Diagonal This example shows how to make an animation to demo the space diagonal of a cuboid. The height grows while assertions check the base diagonal against a² + b² and the space diagonal against a² + b² + c². ![Cuboid Space Diagonal](https://eidograph-docs.metaphorprojects.link/images/examples/animations/cuboid-space-diagonal.png) [Download cuboid-space-diagonal.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/cuboid-space-diagonal.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/cuboid-space-diagonal.eido) ### Cone and Cylinder Volume Ratio This example shows how to make an animation to demo the volume ratio of a cone and a cylinder. A shared radius grows for both solids while the live volume labels stay in a 3:1 ratio. ![Cone and Cylinder Volume Ratio](https://eidograph-docs.metaphorprojects.link/images/examples/animations/cone-and-cylinder-volume-ratio.png) [Download cone-and-cylinder-volume-ratio.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/cone-and-cylinder-volume-ratio.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/cone-and-cylinder-volume-ratio.eido) ### Intersection Circle of Two Spheres This example shows how to make an animation to demo the circle where two spheres meet. The distance between the centers grows and the common circle shrinks, always lying in the perpendicular bisector plane. ![Intersection Circle of Two Spheres](https://eidograph-docs.metaphorprojects.link/images/examples/animations/intersection-circle-of-two-spheres.png) [Download intersection-circle-of-two-spheres.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/intersection-circle-of-two-spheres.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/intersection-circle-of-two-spheres.eido) ### Stella Octangula This example shows how to make an animation to demo the stella octangula. A second congruent tetrahedron rotates until, at 90 degrees, the two interpenetrate around a regular octahedral core. ![Stella Octangula](https://eidograph-docs.metaphorprojects.link/images/examples/animations/stella-octangula.png) [Download stella-octangula.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/stella-octangula.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/stella-octangula.eido) --- URL: https://eidograph-docs.metaphorprojects.link/en/examples/functions # Function and equation graphs Each example below is a standalone `.eido` project holding a single figure that plots a function, a parametric curve, a polar curve or an implicit equation and then animates the numbers inside it. Every download uses the current `.eido` format (manifest `version: 2`) and contains editable Eidolang source. After downloading, choose **Open** in the app header and select the file, or drop the `.eido` file onto the app. You do not have to install anything: the **View in Viewer** link plays the project in the browser. The image in each section is a PNG exported from the same figure with Eidograph's export tool, with the coordinate grid turned on, and shows one frame of the timeline. Open the file to play the whole animation and to drag the sliders yourself. ## Function graphs ### Sine Wave Parameters This example shows how to make an animation to demo what the three numbers in y = a·sin(b·x + c) do to a sine wave. A dashed grey curve stays at y = sin x while a, b and c each move in their own stage, and an orange segment reads the crest height. ![Sine Wave Parameters](https://eidograph-docs.metaphorprojects.link/images/examples/functions/sine-wave-parameters.png) [Download sine-wave-parameters.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/sine-wave-parameters.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/sine-wave-parameters.eido) ### Quadratic Vertex Form This example shows how to make an animation to demo the vertex form of a quadratic, y = a·(x − h)² + k. The vertex is a derived point, a locus records its track as h moves, and an assertion checks that the curve really passes through (h, k). ![Quadratic Vertex Form](https://eidograph-docs.metaphorprojects.link/images/examples/functions/quadratic-vertex-form.png) [Download quadratic-vertex-form.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/quadratic-vertex-form.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/quadratic-vertex-form.eido) ### Shifting and Scaling a Graph This example shows how to make an animation to demo what a shift and a stretch do to the graph of a function. A marked point on the base curve is joined by a vector to its image, and h, k and s take turns moving. ![Shifting and Scaling a Graph](https://eidograph-docs.metaphorprojects.link/images/examples/functions/graph-transformations.png) [Download graph-transformations.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/graph-transformations.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/graph-transformations.eido) ### Exponential and Its Inverse This example shows how to make an animation to demo why the graphs of eˣ and ln x are mirror images. A point runs along the exponential while its swapped coordinates ride the logarithm, and two assertions check the reflection in y = x. ![Exponential and Its Inverse](https://eidograph-docs.metaphorprojects.link/images/examples/functions/exponential-and-its-inverse.png) [Download exponential-and-its-inverse.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/exponential-and-its-inverse.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/exponential-and-its-inverse.eido) ### Polynomial Roots and Factors This example shows how to make an animation to demo the link between the factors of a polynomial and the crossings of its graph. The middle root slides along the x axis and drags exactly one crossing with it while the other two stay put. ![Polynomial Roots and Factors](https://eidograph-docs.metaphorprojects.link/images/examples/functions/polynomial-roots-and-factors.png) [Download polynomial-roots-and-factors.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/polynomial-roots-and-factors.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/polynomial-roots-and-factors.eido) ### Damped Oscillation This example shows how to make an animation to demo how an exponential envelope damps an oscillation. Three plots share the damping parameter, and a marked point sits where the wave touches its envelope. ![Damped Oscillation](https://eidograph-docs.metaphorprojects.link/images/examples/functions/damped-oscillation-envelope.png) [Download damped-oscillation-envelope.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/damped-oscillation-envelope.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/damped-oscillation-envelope.eido) ### Beats from Two Sine Waves This example shows how to make an animation to demo the beats produced when two close frequencies are added. Two sine plots and their sum are drawn with the slow envelope, and an assertion checks the sum-to-product identity. ![Beats from Two Sine Waves](https://eidograph-docs.metaphorprojects.link/images/examples/functions/beats-from-two-sine-waves.png) [Download beats-from-two-sine-waves.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/beats-from-two-sine-waves.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/beats-from-two-sine-waves.eido) ## Calculus in motion ### From Secant to Tangent This example shows how to make an animation to demo the limit that turns a secant line into a tangent. The gap shrinks toward zero while a live label reads the secant slope, which settles on the derivative 4/3. ![From Secant to Tangent](https://eidograph-docs.metaphorprojects.link/images/examples/functions/secant-to-tangent.png) [Download secant-to-tangent.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/secant-to-tangent.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/secant-to-tangent.eido) ### The Derivative Graph This example shows how to make an animation to demo how the slope of a tangent traces out the derivative. A locus records the slope as a height above each x, and the green curve that appears is the graph of f′. ![The Derivative Graph](https://eidograph-docs.metaphorprojects.link/images/examples/functions/derivative-graph-from-slope.png) [Download derivative-graph-from-slope.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/derivative-graph-from-slope.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/derivative-graph-from-slope.eido) ### Taylor Polynomial of the Sine This example shows how to make an animation to demo how closely a degree-5 Taylor polynomial follows the sine. The expansion centre travels along the curve and the polynomial is rebuilt around it on every frame. ![Taylor Polynomial of the Sine](https://eidograph-docs.metaphorprojects.link/images/examples/functions/taylor-polynomial-of-sine.png) [Download taylor-polynomial-of-sine.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/taylor-polynomial-of-sine.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/taylor-polynomial-of-sine.eido) ### Newton's Method This example shows how to make an animation to demo how Newton's method chases a root with tangent lines. Three iterations are derived from the starting guess, and an assertion checks that the third already lands within 0.02 of the root. ![Newton's Method](https://eidograph-docs.metaphorprojects.link/images/examples/functions/newtons-method-iteration.png) [Download newtons-method-iteration.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/newtons-method-iteration.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/newtons-method-iteration.eido) ### Riemann Sum Rectangles This example shows how to make an animation to demo how the choice of sample point changes a Riemann sum. Twelve rectangles slide their sample point from the left edge of each strip to the right, and a live label reads the running estimate. ![Riemann Sum Rectangles](https://eidograph-docs.metaphorprojects.link/images/examples/functions/riemann-sum-rectangles.png) [Download riemann-sum-rectangles.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/riemann-sum-rectangles.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/riemann-sum-rectangles.eido) ## Equations and conics ### Ellipse from Its Equation This example shows how to make an animation to demo the ellipse drawn straight from x²/a² + y²/b² = 1. The implicit equation is redrawn as a and b move, and a point travelling as (a·cos t, b·sin t) is asserted to satisfy it. ![Ellipse from Its Equation](https://eidograph-docs.metaphorprojects.link/images/examples/functions/ellipse-equation-and-axes.png) [Download ellipse-equation-and-axes.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/ellipse-equation-and-axes.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/ellipse-equation-and-axes.eido) ### Hyperbola and Its Asymptotes This example shows how to make an animation to demo how a hyperbola presses against its asymptotes without touching them. The vertices move with a while the dashed lines keep the slopes ±b/a and a parametric point stays on the right branch. ![Hyperbola and Its Asymptotes](https://eidograph-docs.metaphorprojects.link/images/examples/functions/hyperbola-and-asymptotes.png) [Download hyperbola-and-asymptotes.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/hyperbola-and-asymptotes.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/hyperbola-and-asymptotes.eido) ### Superellipse Family This example shows how to make an animation to demo the family of curves |x/a|ⁿ + |y/b|ⁿ = 1. The exponent runs from 0.6 to 6, carrying the curve from a pinched star through the ellipse to a rounded rectangle. ![Superellipse Family](https://eidograph-docs.metaphorprojects.link/images/examples/functions/superellipse-family.png) [Download superellipse-family.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/superellipse-family.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/superellipse-family.eido) ### Folium of Descartes This example shows how to make an animation to demo the folium of Descartes and the asymptote its branches follow. A parametric point sweeps the loop while the implicit cubic is redrawn for each value of a. ![Folium of Descartes](https://eidograph-docs.metaphorprojects.link/images/examples/functions/folium-of-descartes.png) [Download folium-of-descartes.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/folium-of-descartes.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/folium-of-descartes.eido) ### Cassini Ovals and the Lemniscate This example shows how to make an animation to demo the curves on which the product of two focal distances is constant. Shrinking the constant pinches one oval into the lemniscate of Bernoulli and then splits it into two loops. ![Cassini Ovals and the Lemniscate](https://eidograph-docs.metaphorprojects.link/images/examples/functions/cassini-ovals-and-lemniscate.png) [Download cassini-ovals-and-lemniscate.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/cassini-ovals-and-lemniscate.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/cassini-ovals-and-lemniscate.eido) ## Parametric and polar curves ### Lissajous Figures This example shows how to make an animation to demo the braided curves made by two perpendicular oscillations. A rider travels the curve first, then the phase and the frequency ratio each take a turn. ![Lissajous Figures](https://eidograph-docs.metaphorprojects.link/images/examples/functions/lissajous-figures.png) [Download lissajous-figures.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/lissajous-figures.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/lissajous-figures.eido) ### Polar Rose This example shows how to make an animation to demo how the petal count of r = 3·cos(k·θ) depends on k. A sweeping arm reads the current radius while k grows from 2 to 8. ![Polar Rose](https://eidograph-docs.metaphorprojects.link/images/examples/functions/polar-rose.png) [Download polar-rose.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/polar-rose.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/polar-rose.eido) ### Limaçon and Cardioid This example shows how to make an animation to demo the limaçon family and the cardioid hiding inside it. One shape parameter carries the curve from a circle through the cardioid cusp to a curve with an inner loop. ![Limaçon and Cardioid](https://eidograph-docs.metaphorprojects.link/images/examples/functions/limacon-and-cardioid.png) [Download limacon-and-cardioid.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/limacon-and-cardioid.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/limacon-and-cardioid.eido) ### Archimedean Spiral This example shows how to make an animation to demo why the turns of an Archimedean spiral are evenly spaced. Two coloured segments measure consecutive gaps on the x axis and an assertion checks that they stay equal. ![Archimedean Spiral](https://eidograph-docs.metaphorprojects.link/images/examples/functions/archimedean-spiral.png) [Download archimedean-spiral.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/archimedean-spiral.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/archimedean-spiral.eido) ### Spirograph Epitrochoid This example shows how to make an animation to demo the curve a spirograph pen draws as one circle rolls around another. The rolling circle stays tangent to the fixed one while the pen arm sweeps out a four-lobed epitrochoid. ![Spirograph Epitrochoid](https://eidograph-docs.metaphorprojects.link/images/examples/functions/epitrochoid-spirograph.png) [Download epitrochoid-spirograph.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/epitrochoid-spirograph.eido) · [View in Viewer](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/epitrochoid-spirograph.eido) --- URL: https://eidograph-docs.metaphorprojects.link/en/agents/integration # MCP, REST, and the in-app Agent Eidograph offers three paths for agents, all ending at the same tool surface: | Path | Best for | Available in | | --- | --- | --- | | In-app Agent | Natural-language changes to the current project | Windows and Android apps | | MCP Streamable HTTP | Agent platforms that support remote HTTP MCP | Windows app | | JSON REST API | Scripts, workflows, and custom agents | Windows app | Before a tool changes a script, Eidograph compiles the candidate. An edit with compiler errors or a skipped-command warning is rejected and the current script is unchanged. Successful edits persist, redraw, and enter normal undo history immediately. ## Enable the native server 1. In the installed app, open **Settings › MCP / REST server**. 2. Enable the server and confirm that its status is running. The default port is `14159`. 3. Enable only the tools the client needs. 4. In **Figures**, inspect the exposure dot beside each figure. A filled dot means external clients may access it. 5. Keep the default loopback binding unless you are on a trusted network. Default endpoints: ```txt MCP http://127.0.0.1:14159/mcp REST http://127.0.0.1:14159/api/v1 ``` **Danger** LAN mode binds to `0.0.0.0` and has no internet relay. Native clients on that network can invoke the tools you enabled, so turn on an access token before you turn LAN mode on, use it only on a trusted network, and turn it off afterward. ## Require an access token The server is unauthenticated by default, which is safe enough while it stays on loopback: only programs already running on your PC can reach it. Turn on **Settings › MCP / REST server › Require an access token** — always before enabling LAN mode — and Eidograph generates a secret that every request must carry: ```txt Authorization: Bearer ``` Requests without it are answered `401`. Settings shows the token with a copy button, **Replace the token** rotates it, and switching it off clears it. Both take effect at once, so update every client you have configured. ## Find the server from another program The port is a setting, so nothing outside the app can assume it. While the listener is up Eidograph publishes a discovery file, and deletes it when the server stops or the app quits: | Platform | Path | | --- | --- | | Windows | `%LOCALAPPDATA%\eidograph.metaphor.projects\server.json` | | macOS | `~/Library/Application Support/eidograph.metaphor.projects/server.json` | | Linux | `$XDG_DATA_HOME/eidograph.metaphor.projects/server.json` | ```json { "version": "0.2.19", "pid": 24680, "updatedAt": 1757000000000, "bindAddress": "127.0.0.1", "port": 14159, "mcp": "http://127.0.0.1:14159/mcp", "api": "http://127.0.0.1:14159/api/v1", "token": "3f9c…", "lanAddresses": [] } ``` Read `mcp` or `api`, and send `token` as a bearer token; it is `null` when none is required. The published URLs stay on loopback even in LAN mode, because every reader of this file is on the same machine. **Settings › MCP / REST server** shows the exact path and copies it. Treat a missing file as "the server is not running" rather than falling back to a guessed port. ## Claude Desktop Claude Desktop installs MCP servers as local **stdio** processes, so an HTTP URL cannot be pasted into it directly. Install the [eidograph-mcpb](https://github.com/metaphorprojects/eidograph-mcpb) extension to bridge the two — it needs no configuration, finding the port and access token by itself and re-reading them on every request. See [Claude Desktop](https://eidograph-docs.metaphorprojects.link/en/agents/claude-desktop) for step-by-step installation with screenshots, and how to point it at Eidograph running on another device. ## Connect an MCP platform For a client that supports **Streamable HTTP**—including the Trae / WorkBuddy configuration copied by the app—add this server: ```json { "mcpServers": { "Eidograph": { "url": "http://127.0.0.1:14159/mcp", "transport": "streamable-http", "disabled": false } } } ``` Platforms differ in configuration file location and outer schema, but the essential values are the server name, URL, and Streamable HTTP transport. If a platform supports only a local `stdio` MCP process, do not put this URL in its `command` field; use an HTTP connector or bridge supported by that platform. After connecting, let the client discover tools, then read the current script or command registry. A reliable agent sequence is: 1. `list_figures` to confirm the target; 2. `get_script` and `list_objects` to understand the current figure; 3. `list_commands` to inspect valid syntax for the active 2D/3D dialect; 4. `append_commands` for additive changes, and `set_script` only when existing lines must be rewritten; 5. `list_diagnostics` to verify the result and correct any issue. ## Call the REST API For endpoint contracts, every tool schema, export encoding, error behavior, and JavaScript/Python/PowerShell examples, see the [REST API Reference](https://eidograph-docs.metaphorprojects.link/en/agents/rest-api). Check status and tool discovery first: ```bash curl http://127.0.0.1:14159/api/v1/status curl http://127.0.0.1:14159/api/v1/tools ``` Create two points and a segment: ```bash curl -X POST http://127.0.0.1:14159/api/v1/tools/append_commands \ -H "Content-Type: application/json" \ -H "X-Eidograph-Client: my-agent" \ -d '{"commands":"point A -2 0\npoint B 2 0\nsegment s A B"}' ``` Responses use one envelope: `{"ok":true,"result":...}` on success or `{"ok":false,"error":...}` on failure. The optional `X-Eidograph-Client` header gives the caller a readable name in Settings activity. The current surface can read and list figures, create figures, append or replace scripts, list objects/diagnostics/commands, select an object on canvas, and export an exposed figure as SVG, PNG, GIF, or MP4. Tool permissions and figure exposure are enforced on every call. ## Configure the in-app Agent Save several models in **Settings › Agent**, then switch among them from the Agent header. Eidograph supports three protocol families: - OpenAI-compatible Chat Completions endpoints; - Anthropic Messages; - Google Gemini / Vertex `generateContent`. Each saved model has a display name, provider, Base URL, API key, and model ID. You can enter an ID manually if model discovery fails. Local endpoints such as Ollama and LM Studio can work as well, but the endpoint must allow cross-origin requests from the app's WebView (CORS). The in-app Agent accepts attached or pasted images, which is useful for turning a textbook photo or sketch into a construction. Vision support is determined by the model endpoint; an unsupported request appears as an error in the conversation. In the Windows and Android apps the Agent can also research on the web: **web_search** looks up a theorem, construction, or reference figure through DuckDuckGo, and **web_fetch** reads a page as text or looks at an image by URL, for example a diagram to reproduce. Only public websites are reachable. These two tools belong to the in-app Agent alone; they are not part of the MCP/REST surface. ## Permissions and data boundaries - In-app and external agents have no hidden privileged path; both use the same tool definitions. - External edits target the active project and honor each figure's exposure state. - API keys are never written to `.eido`. The Windows and Android apps use protected OS credential storage. - Agent chats are excluded from `.eido` by default and are shared only when **Include agent chats** is enabled explicitly. --- URL: https://eidograph-docs.metaphorprojects.link/en/agents/rest-api # REST API Reference Eidograph's REST API lets a local script or custom agent inspect and edit the project open in the Windows app. It exposes the same tools, compiler validation, undo history, figure permissions, and usage limits as the MCP server. The API is served by the installed Windows app. Eidograph must remain open while a client uses it; there is no hosted REST service or user-facing Web edition. ## Quick start 1. Open **Settings › MCP / REST server** in Eidograph. 2. Enable the server and the tools your client will call. 3. In **Figures**, make the target figure's exposure dot filled. 4. Confirm that the status is running. The default base URL is: ```txt http://127.0.0.1:14159/api/v1 ``` Discover the enabled tools, then append a construction to the current figure: ```bash curl http://127.0.0.1:14159/api/v1/tools curl -X POST http://127.0.0.1:14159/api/v1/tools/append_commands \ -H "Content-Type: application/json" \ -H "X-Eidograph-Client: geometry-script" \ -d '{"commands":"point A -2 0\npoint B 2 0\nsegment s A B"}' ``` A successful tool call returns: ```json { "ok": true, "result": "ok — no diagnostics" } ``` ## Transport and security ### Base URL and JSON All paths below are relative to `http://127.0.0.1:14159/api/v1`. If the port changes in Settings, update the URL — or read the current one from the discovery file the app publishes while its server runs, described in [MCP, REST, and the in-app Agent](https://eidograph-docs.metaphorprojects.link/en/agents/integration). Tool calls use `POST` with a JSON object and `Content-Type: application/json`. Responses are JSON except for framework-level errors such as an unsupported method. There is no API version negotiation: `/api/v1` is the current REST surface. ### Authentication and network scope The server has no TLS, and no password unless you give it one. Loopback mode is the safe default and accepts clients on the same computer only. **Allow clients on the same network** binds the server to `0.0.0.0`; any device that can reach the port can invoke every enabled tool against every exposed figure. Turn on **Require an access token** in the same settings pane — always before enabling LAN mode — and every request must carry the generated secret: ```http Authorization: Bearer ``` Requests without it are answered `401` with `{"ok":false,"error":"missing or invalid bearer token"}`. This covers `/status` and `/activity` as well as tool calls. The token is published in the discovery file, so a client on this machine can read it rather than being configured with it. **Danger** Use LAN mode only on a trusted network. Do not forward the port, publish it through a tunnel, or expose it to the internet. The optional request header below is a display label, not authentication: ```http X-Eidograph-Client: my-automation ``` Eidograph uses it as the caller name in external activity. Without it, the caller's IP address is recorded. ### Origin checks Requests without an `Origin` header—normal for command-line tools, Node.js, Python, PowerShell, and native agents—are accepted. If a client sends `Origin`, its host must be `localhost`, `127.0.0.1`, or `::1`; otherwise tool discovery and tool calls return `403`. The REST API is intended for native and command-line clients, not arbitrary browser pages. Browser CORS and preflight behavior may block a request even when its origin host is local. ### Access and side effects Every tool call is checked at execution time: - **Settings › MCP / REST server › Tools** controls the tool allow-list. - A figure's filled exposure dot controls whether external clients can see it. - Current-figure tools act on the project and figure active in the UI. - `create_figure` creates and activates a figure. `select_object` changes the canvas selection. - Script edits compile before commit. An error or skipped-command warning rejects the whole edit, leaving the current script unchanged. - Successful edits redraw immediately, persist in the workspace, and enter normal undo history. Do not send concurrent edits that depend on the same script version. Serialize them and call `get_script` again before a rewrite. ## Common headers and request bodies The direct body form is recommended: ```http POST /api/v1/tools/get_figure_script Content-Type: application/json X-Eidograph-Client: docs-example {"name":"Figure 2"} ``` For clients that already use an RPC-style envelope, the server also accepts an `arguments` wrapper: ```json { "arguments": { "name": "Figure 2" } } ``` No-argument tools may receive `{}` or an empty request body. ## Response and error model Tool success uses this envelope: ```json { "ok": true, "result": "tool-specific value" } ``` Tool failure uses: ```json { "ok": false, "error": "tool `set_script` is disabled" } ``` Most read tools return text. `list_figures`, `list_objects`, and `list_commands` return a **JSON-encoded string** inside `result`, so parse `result` once more when structured data is needed. `export_figure` is the exception: it returns a JSON object directly. | HTTP status | Meaning | | --- | --- | | `200 OK` | Status/activity read, successful discovery, or successful tool call | | `400 Bad Request` | Tool error, invalid arguments, disabled/unknown tool, unavailable figure, compiler rejection, or exhausted allowance | | `403 Forbidden` | Untrusted `Origin` on discovery or a tool call | | `503 Service Unavailable` | Tool discovery could not reach the Eidograph UI bridge | | `404 Not Found` | Unknown route | | `405 Method Not Allowed` | Known route called with an unsupported HTTP method | A malformed JSON document or wrong content type can produce a framework error rather than the normal `{ "ok": false }` envelope. Clients should check both the HTTP status and the JSON `ok` field when present. ## Endpoints ### `GET /status` Returns native server state directly, without an `ok` envelope. ```bash curl http://127.0.0.1:14159/api/v1/status ``` Example while running in loopback mode: ```json { "running": true, "bridgeReady": true, "bindAddress": "127.0.0.1", "port": 14159, "lanAddresses": [], "lastError": null } ``` | Field | Type | Description | | --- | --- | --- | | `running` | boolean | The HTTP listener is running. | | `bridgeReady` | boolean | The app UI can currently execute tool requests. | | `bindAddress` | string or null | Listener address, normally `127.0.0.1` or `0.0.0.0`. | | `port` | integer or null | Actual listener port. | | `lanAddresses` | array of strings | Every base address a same-network client can dial, best first (private ranges first), at most 10. Empty unless LAN mode is enabled. | | `lastError` | string or null | Most recent listener error. | `running: true` and `bridgeReady: false` means the port is open but tools cannot execute yet. Wait for both to be true. ### `GET /activity` Returns up to 200 most recent MCP and REST tool calls, newest first. Status checks, activity reads, and tool discovery are not recorded. ```bash curl http://127.0.0.1:14159/api/v1/activity ``` ```json { "activity": [ { "id": "342daa36-e4d3-4c96-aebe-d358d60a96dd", "at": 1788112800123, "transport": "rest", "caller": "geometry-script", "tool": "append_commands", "ok": true, "durationMs": 18 } ] } ``` `at` is Unix time in milliseconds. `durationMs` measures the complete bridge/tool call. The caller label is supplied by the client and should not be treated as a verified identity. ### `GET /tools` Discovers only the tools currently enabled in Settings. It does not consume a tool-call allowance. ```bash curl \ -H "X-Eidograph-Client: schema-reader" \ http://127.0.0.1:14159/api/v1/tools ``` Abbreviated response: ```json { "ok": true, "tools": [ { "name": "append_commands", "description": "Append one or more command lines...", "inputSchema": { "type": "object", "properties": { "commands": { "type": "string", "description": "command lines, newline-separated" } }, "required": ["commands"] } } ] } ``` Treat this endpoint as the runtime authority: tool descriptions and schemas come from the same definitions used by the app and MCP server. ### `POST /tools/{tool}` Executes one enabled tool. Replace `{tool}` with a discovered tool name and put its arguments in the JSON body. ```bash curl -X POST http://127.0.0.1:14159/api/v1/tools/list_objects \ -H "Content-Type: application/json" \ -d '{}' ``` Every executed call consumes an external API allowance, including a call that reaches a tool and then fails. Status, activity, and discovery requests are free. An export also uses the export allowance after it successfully produces bytes. Eidograph Pro removes these limits; the app's **Settings › Account** page shows the current free allowance. ## Tool reference The schemas returned by `GET /tools` are authoritative. The catalog below documents the full current surface; disabled tools are omitted from discovery and rejected if called directly. ### `get_script` Reads the active, exposed figure's complete Eidolang source. **Body:** `{}` **Result:** string containing the source exactly as stored. ```bash curl -sS -X POST "$EIDO_API/tools/get_script" \ -H "Content-Type: application/json" -d '{}' ``` ### `list_figures` Lists exposed figures in the active project, ordered by creation time. Unexposed figures are omitted. **Body:** `{}` **Result:** JSON-encoded array string with: | Field | Type | Description | | --- | --- | --- | | `name` | string | Figure display name. | | `kind` | `plane` or `solid` | Fixed 2D/3D dialect. | | `active` | boolean | Whether current-figure tools target it. | Decoded result example: ```json [ { "name": "Construction", "kind": "plane", "active": true }, { "name": "Solid model", "kind": "solid", "active": false } ] ``` ### `get_figure_script` Reads an exposed figure by exact display name without activating it. Edits still target the active figure. **Body:** ```json { "name": "Solid model" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | yes | Name returned by `list_figures`. | **Result:** source string. ### `create_figure` Creates a figure in the active project and makes it active. Use it when the project is empty or the work belongs in a new figure. **Body:** ```json { "kind": "plane", "name": "API construction" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `kind` | `plane` or `solid` | yes | The figure's fixed Eidolang dialect. | | `name` | string | no | Requested display name; Eidograph supplies one when omitted. | **Result:** confirmation string. ### `append_commands` Appends newline-separated Eidolang commands to the active figure. Prefer it for additive edits because it preserves all existing lines. **Body:** ```json { "commands": "point O 0 0\ncircle c O radius 3" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `commands` | string | yes | One or more newline-separated Eidolang commands. | **Result:** a diagnostics summary. The edit is committed only when compilation has no errors or skipped-command warnings. ```json { "ok": true, "result": "error line 2: unknown command `circel`\n hint: ...\nedit not applied — the current script is unchanged. Fix the first reported issue; later errors may be consequences, then retry." } ``` Compiler rejection is reported in `result` because the tool executed successfully but declined to commit the candidate. Check the returned text rather than relying only on `ok`. ### `set_script` Replaces the active figure's complete source. Use it only when existing lines must be changed or removed. Read `get_script` immediately beforehand to avoid overwriting a newer edit. **Body:** ```json { "source": "space plane\npoint O 0 0\ncircle c O radius 3\n" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `source` | string | yes | Full replacement source. | **Result:** diagnostics summary. Like `append_commands`, the replacement is transactional and may return `ok: true` with an “edit not applied” diagnostic. ### `list_objects` Lists the compiled objects in the active figure. **Body:** `{}` **Result:** JSON-encoded array string with: | Field | Type | Description | | --- | --- | --- | | `name` | string | Eidolang object identifier. | | `kind` | string | Command/object kind. | | `tier` | string or null | Freedom tier such as `free`, `bound`, or `derived`. | | `status` | string | Evaluation status. | | `info` | string | Short value summary, or the failure reason for an invalid object. | Decoded result example: ```json [ { "name": "A", "kind": "point", "tier": "free", "status": "ok", "info": "(-2, 0)" }, { "name": "s", "kind": "segment", "tier": "derived", "status": "ok", "info": "len 4" } ] ``` ### `list_diagnostics` Returns current compiler and runtime diagnostics for the active figure. **Body:** `{}` **Result:** human-readable string. With no diagnostics it is `ok — no diagnostics`; otherwise each item includes severity, optional line, message, and optional hint. ### `list_commands` Lists the live command registry for the active figure's `plane` or `solid` dialect. Use it before generating unfamiliar Eidolang. **Body:** `{}` **Result:** JSON-encoded array string. Each decoded item contains `kind` and `signature`. ```json [ { "kind": "point", "signature": "point | point polar | ..." }, { "kind": "segment", "signature": "segment " } ] ``` Signatures can evolve with the app, so generated clients should prefer discovery over a hard-coded command list. ### `select_object` Selects and highlights a compiled object in the active canvas so the user can see what the client means. **Body:** ```json { "name": "s" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | yes | An object name returned by `list_objects`. | **Result:** confirmation string such as `selected s`. ### `export_figure` Exports an exposed figure through its live renderer. A named, non-active figure is mounted temporarily and the original active figure is restored afterward. **Body:** ```json { "figure": "Construction", "format": "png", "region": "content", "scale": 2, "transparent": true, "grid": false } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `figure` | string | no | Exact exposed figure name; defaults to the active figure. | | `format` | `svg`, `png`, `gif`, or `mp4` | yes | Output encoding. | | `region` | `view` or `content` | no | Current view or fitted figure; defaults to `content`. | | `crop` | object | no | Plane-only screen-space rectangle `{ x, y, width, height }`; overrides `region`. Width and height must be positive. | | `scale` | `1`, `2`, or `4` | no | Raster pixel-density multiplier for `png`, `gif`, and `mp4`; defaults to the app export preference. | | `transparent` | boolean | no | Plane still images only; defaults to the app export preference. | | `grid` | boolean | no | Include coordinate grid; defaults to the app export preference. | | `fps` | integer 1–60 | no | Animation frame rate for `gif` and `mp4`; defaults to the app export preference. | | `seconds` | number 0.1–3600 | no | Animation duration for `gif` and `mp4`; defaults to one loop of the timeline. | | `mode` | `timeline` or `orbit` | no | Motion source for `gif` and `mp4`; defaults to `timeline`. | Solid figures reject `transparent: true`, and custom crops are supported only for plane figures. ### Animated exports `gif` and `mp4` render the figure's `animate` and `stage` timeline frame by frame. `mode: "orbit"` instead spins the camera around a solid figure, which works on a static model but is rejected for plane figures. Transparency is not available for either format. A render is capped at 1800 frames, so a long, high-frame-rate request is trimmed. These calls take much longer than a still export — seconds to minutes — and `export_figure` is given a 600-second budget rather than the 30 seconds every other tool has. MP4 also needs H.264 WebCodecs support in the app's webview. ```json { "format": "mp4", "mode": "orbit", "seconds": 6, "fps": 30, "scale": 2 } ``` **Result:** object: ```json { "figure": "Construction", "fileName": "Construction.png", "format": "png", "mimeType": "image/png", "encoding": "base64", "data": "iVBORw0KGgoAAA..." } ``` SVG returns `mimeType: "image/svg+xml"`, `encoding: "utf8"`, and SVG markup in `data`. PNG, GIF, and MP4 return base64 data with no `data:` URL prefix, under `image/png`, `image/gif`, and `video/mp4` respectively. Animated results carry an extra `animation` object describing what was actually rendered, so you can tell when the frame cap shortened the request: ```json { "animation": { "mode": "orbit", "seconds": 6, "frames": 180, "fps": 30, "capped": false } } ``` Over MCP, PNG and GIF arrive as native `image` content and MP4 as an embedded binary `resource`, because MCP has no video content type. ### `save_project` Saves the active project to disk as a `.eido` package. Writes directly to a path — no native save dialog appears, since none of these tools have a user present to click one. **Body:** ```json { "path": "C:\\Users\\me\\Documents\\Construction.eido" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `path` | string | conditionally | Absolute file path to save to. Required the first time a project is saved; omit afterward to overwrite the project's known file. `.eido` is appended if missing. | **Result:** the absolute path the project was saved to. ### `open_project` Opens a `.eido` package (or a bare `.geo`/`.txt` script) from an absolute file path as a new project tab — the headless equivalent of the app's Open dialog. **Body:** ```json { "path": "C:\\Users\\me\\Documents\\Construction.eido" } ``` | Argument | Type | Required | Description | | --- | --- | --- | --- | | `path` | string | yes | Absolute file path to open. | **Result:** confirmation string once the project is open and active. ## Complete client examples ### JavaScript (Node.js 20+) This is server-side Node.js code, not browser code. ```js const baseUrl = 'http://127.0.0.1:14159/api/v1' async function callTool(name, arguments_ = {}) { const response = await fetch(`${baseUrl}/tools/${encodeURIComponent(name)}`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Eidograph-Client': 'node-example', }, body: JSON.stringify(arguments_), }) const body = await response.json() if (!response.ok || !body.ok) { throw new Error(body.error || `HTTP ${response.status}`) } return body.result } const figures = JSON.parse(await callTool('list_figures')) console.log(figures) const diagnostics = await callTool('append_commands', { commands: 'point A -2 0\npoint B 2 0\nsegment s A B', }) console.log(diagnostics) ``` ### Python 3, including PNG export This example uses only the Python standard library. ```python import base64 import json from pathlib import Path from urllib.error import HTTPError from urllib.request import Request, urlopen BASE_URL = "http://127.0.0.1:14159/api/v1" def call_tool(name, arguments=None): payload = json.dumps(arguments or {}).encode("utf-8") request = Request( f"{BASE_URL}/tools/{name}", data=payload, method="POST", headers={ "Content-Type": "application/json", "X-Eidograph-Client": "python-example", }, ) try: with urlopen(request) as response: body = json.load(response) except HTTPError as error: body = json.load(error) raise RuntimeError(body.get("error", f"HTTP {error.code}")) from error if not body.get("ok"): raise RuntimeError(body.get("error", "unknown Eidograph error")) return body["result"] print(call_tool("list_diagnostics")) export = call_tool("export_figure", { "format": "png", "region": "content", "scale": 2, "grid": False, }) Path(export["fileName"]).write_bytes(base64.b64decode(export["data"])) print(f"saved {export['fileName']}") ``` For SVG, write `export["data"]` as UTF-8 text instead of base64-decoding it. ### PowerShell 7+ ```powershell $baseUrl = 'http://127.0.0.1:14159/api/v1' $headers = @{ 'X-Eidograph-Client' = 'powershell-example' } $commands = @' point O 0 0 circle c O radius 3 point P on c at 45deg segment radius O P '@ $body = @{ commands = $commands } | ConvertTo-Json $response = Invoke-RestMethod ` -Method Post ` -Uri "$baseUrl/tools/append_commands" ` -Headers $headers ` -ContentType 'application/json' ` -Body $body if (-not $response.ok) { throw $response.error } $response.result ``` ### Create a figure and replace its script ```bash export EIDO_API='http://127.0.0.1:14159/api/v1' curl -sS -X POST "$EIDO_API/tools/create_figure" \ -H 'Content-Type: application/json' \ -H 'X-Eidograph-Client: curl-workflow' \ -d '{"kind":"plane","name":"Circle API demo"}' curl -sS -X POST "$EIDO_API/tools/set_script" \ -H 'Content-Type: application/json' \ -H 'X-Eidograph-Client: curl-workflow' \ -d '{"source":"space plane\npoint O 0 0\ncircle c O radius 3\npoint P on c at 45deg\nsegment radius O P\n"}' curl -sS -X POST "$EIDO_API/tools/list_diagnostics" \ -H 'Content-Type: application/json' \ -d '{}' ``` ## Troubleshooting | Symptom | What to check | | --- | --- | | Connection refused | Enable the server, confirm the port, keep Eidograph open, and check `/status`. | | `bridgeReady` is false | Wait for the project UI to finish loading or restart the app. | | `tool ... is disabled` | Enable it under **Settings › MCP / REST server › Tools**, then rediscover tools. | | `no figure is open` | Call `create_figure`, or open and expose a figure in the app. | | `the current figure is not exposed` | Fill its exposure dot in **Figures**. | | “edit not applied” in a successful result | Fix the first compiler diagnostic and retry; the existing script is intact. | | `403 untrusted Origin` | Use a native/CLI client or remove the non-local `Origin`; do not weaken LAN security. | | Export cannot switch figures | Finish the operation that locks figure switching, activate the target manually, or export the current figure. | | Daily limit error | Review **Settings › Account** and wait for the daily reset or unlock Pro. | | Request times out after 30 seconds | Bring Eidograph to a healthy state, avoid parallel long-running calls, and retry after checking `/status`. | For agent-oriented discovery and resources over Streamable HTTP, see [MCP, REST, and the in-app Agent](https://eidograph-docs.metaphorprojects.link/en/agents/integration). --- URL: https://eidograph-docs.metaphorprojects.link/en/agents/claude-desktop # Claude Desktop Claude Desktop installs MCP servers as local **stdio** processes, so Eidograph's Streamable HTTP endpoint cannot be pasted into it directly. [eidograph-mcpb](https://github.com/metaphorprojects/eidograph-mcpb) is a small `.mcpb` bundle that bridges the two: it speaks stdio to Claude Desktop and forwards each request to the endpoint published in Eidograph's [discovery file](https://eidograph-docs.metaphorprojects.link/en/agents/integration#find-the-server-from-another-program). Everything stays on your machine — no traffic leaves loopback unless you point it at another device yourself (see below). ## Install the extension 1. Download the latest `eidograph.mcpb` from the [eidograph-mcpb repository](https://github.com/metaphorprojects/eidograph-mcpb) on GitHub. 2. Open the downloaded file, or drag it onto Claude Desktop's **Settings › Extensions** page. Claude Desktop shows the extension's details and an **Install** button: ![Claude Desktop showing the Eidograph extension's install page](https://eidograph-docs.metaphorprojects.link/images/agents/claude-desktop/extension-install.png) **Warning** Claude Desktop warns that any extension can access everything on your computer — that warning is generic to all extensions. eidograph-mcpb only relays JSON-RPC between Claude Desktop and Eidograph's loopback HTTP endpoint; it does not touch the filesystem or the network beyond that. 3. Click **Install**. Eidograph then appears in **Settings › Extensions** alongside your other installed extensions: ![Claude Desktop's Extensions settings listing the installed Eidograph extension](https://eidograph-docs.metaphorprojects.link/images/agents/claude-desktop/extensions-settings.png) No further setup is required. The extension re-reads Eidograph's discovery file on every request, so starting the app, enabling its server, or changing its port all take effect without reinstalling or restarting anything. If Eidograph is closed or its server is off, tool calls fail with an error naming the setting to turn on. ## Configure a custom server address Click **Configure** next to Eidograph in the Extensions list to open its settings: ![Eidograph extension configuration page with endpoint, token, and discovery file overrides](https://eidograph-docs.metaphorprojects.link/images/agents/claude-desktop/extension-configure.png) All three fields are optional, and exist only for cases the discovery file cannot cover: | Setting | Effect | | --- | --- | | Endpoint override | Dial this address instead of the one Eidograph publishes. Accepts `http://host:port` or a full `.../mcp` URL. | | Access token override | Send this token instead of the one Eidograph publishes. | | Discovery file override | Read the handshake from this path instead of the standard OS location. | This is what you need when Eidograph runs on a **different device** than Claude Desktop — for example the Android app on a phone or tablet, while Claude Desktop runs on your computer: 1. On the device running Eidograph, open **Settings › MCP / REST server** and turn on **Require an access token** first, then **LAN mode** — in that order, since LAN mode accepts connections from other devices on the network. 2. Note the LAN address and port shown there (for example `http://192.168.1.23:14159`), and copy the access token. 3. Back in Claude Desktop's Eidograph configuration page, set **Endpoint override** to that address and **Access token override** to the copied token, then **Save**. **Danger** LAN mode has no internet relay, but any device on that network can call the tools you enabled once it knows the address. Keep an access token on, use LAN mode only on a trusted network, and turn it off when you are done. ## Uninstalling or updating Toggle the extension off or click **Uninstall** from the Extensions list. To update, install a newer `eidograph.mcpb` the same way — Claude Desktop replaces the previous version in place. --- URL: https://eidograph-docs.metaphorprojects.link/en/faq # Frequently asked questions ## Why can’t I drag some points? Orange free points drag directly, purple bound points move only along a path, and gray derived points are calculated by expressions. Move a derived point by dragging one of its free or bound inputs. ## Can canvas actions conflict with the script? No. Tools, dragging, property changes, and parameter sliders all edit the same Eidolang text. The text is the single source of truth; the canvas is its live evaluated result. ## What is the difference between `.eido` and `.txt`? An `.eido` file is a complete project with multiple figures, a manifest, and project settings. A `.txt` or `.geo` file is one bare Eidolang script. Opening `.eido` creates a project tab; dropping `.txt` or `.geo` adds a figure to the active project. ## Why did my view or zoom change after reopening? Camera direction, pan/zoom, grid style, and selection are local view state and are not stored in `.eido`. The project's zoom limits and auto-dock setting are stored. ## Can I convert a 2D figure to 3D? Not directly. A figure is fixed as `plane` or `solid` at creation and uses that Eidolang dialect. Create a figure of the other kind and rewrite the construction for that space. ## MCP is connected, but why can’t it see my figure? Confirm that the app is on the target project, the figure's exposure dot is filled, and the required read tool is enabled. External calls can access only exposed figures in the active project. ## Why is the coordinate grid missing from an export? The export dialog has its own **Coordinate grid** toggle. Export defaults only set its initial value, and every export can override it. ## Are Agent chats shared with my project? Not by default. A saved `.eido` includes project conversations only after **Settings › General › Include agent chats** is enabled. API keys are never written to a project file. --- URL: https://eidograph-docs.metaphorprojects.link/ # Eidograph — 为人类与 Agent 构建几何 在 2D 与 3D 画布上绘图,用 Eidolang 精确描述,并与 Agent 共同编辑。 - **图形与脚本同步**: 拖动、工具操作和参数调整都会写回 Eidolang;脚本始终是图形的唯一事实来源。 - **2D 与 3D**: 在同一项目中组织多个平面或立体图形,使用一致的对象、诊断和参数面板。 - **清晰的导出与文件**: 项目保存为可移植的 .eido 包;图形可导出为 SVG、PNG、GIF 或 MP4。 - **Agent 原生集成**: 应用内对话与外部 MCP/REST 客户端共享同一组受控工具和编译流程。 ## 从这里开始 第一次使用,请先完成[快速上手](https://eidograph-docs.metaphorprojects.link/guide/getting-started)。如果你已经熟悉画布,可以查阅 [Eidolang 参考](https://eidograph-docs.metaphorprojects.link/eidolang/reference)、下载[示例项目](https://eidograph-docs.metaphorprojects.link/examples/),或直接[连接 Agent](https://eidograph-docs.metaphorprojects.link/agents/integration)。AI 客户端可以从 [LLMs.txt](https://eidograph-docs.metaphorprojects.link/llms.txt) 获取完整文档索引。 --- URL: https://eidograph-docs.metaphorprojects.link/guide/installation # 安装 Eidograph Eidograph 通过应用商店提供 Windows 与 Android 版本。打开下面的官方页面,选择适合你设备的应用商店,然后按照商店提示完成安装: **[前往 Eidograph 官方下载页](https://metaphorprojects.link/eidograph/)** 通过应用商店安装后,更新也由商店自动管理。若要卸载,请使用 Windows 的“已安装的应用”或 Android 的应用信息页面。 首次启动时,Eidograph 会建立本机工作区并打开示例项目。建议把需要长期保留的项目另存为 `.eido` 文件。 安装完成后继续阅读[快速上手](https://eidograph-docs.metaphorprojects.link/guide/getting-started)。 --- URL: https://eidograph-docs.metaphorprojects.link/guide/getting-started # 快速上手 本页带你安装并创建第一个动态几何构造。Eidograph 的核心很简单:画布上的每一步操作都会变成 Eidolang 文本,因此图形可以精确保存、复现和交给 Agent 编辑。 ## 安装与首次启动 从 [Eidograph 官方下载页](https://metaphorprojects.link/eidograph/)进入适合你设备的应用商店并安装。启动 Eidograph 后,应用会自动创建一个带示例的未命名项目和一个 2D 图形。 **Tip** 项目仍在早期开发。不同测试版本间如果本地工作区无法载入,应用会回到默认工作区;请把需要长期保留的项目保存为 `.eido` 文件。 ## 认识界面 ![Eidograph 中文主界面:画布、工具栏、图形列表和 Eidolang 编辑器](https://eidograph-docs.metaphorprojects.link/images/app-overview-zh.png) - 顶部标签代表项目;每个 `.eido` 文件对应一个项目。 - 左侧工具栏用于选择、创建点、线段、圆等对象,以及撤销、重做和导出。 - 中间是可缩放、平移和直接拖动的画布。 - 右侧上方管理项目中的图形;每个图形创建时固定为 2D 或 3D。 - 右侧下方可切换 **Eidolang**、**对象**和**参数**,底部显示诊断。 ## 创建第一个构造 1. 点击左侧的**点**工具,在画布上点击两次,创建两个自由点。 2. 选择**线段**工具,依次点击这两个点。 3. 切回**指针**工具,拖动任一点。线段会实时跟随。 4. 打开右侧 **Eidolang** 面板。你会看到类似下面的脚本: ```txt space plane point A -3 0 point B 3 0 segment s A B ``` 你也可以直接粘贴这段脚本。修改坐标后,画布会立即重新计算。橙色点是可自由拖动的对象;紫色点绑定在路径上;灰色点由其他对象推导,需通过它的输入来移动。 ## 保存与再次打开 点击顶部的项目标签并选择**保存**,或按 `Ctrl/⌘ K` 打开命令面板后运行保存命令。项目会写为一个 `.eido` 文件,其中包含项目内所有图形及其纯文本脚本。 - 打开 `.eido`:创建一个新的项目标签。 - 拖入 `.txt` 或 `.geo`:把单个脚本加入当前项目。 - 首次保存时选择文件名和位置;之后可继续覆盖保存,使用**另存为**可选择新位置。 下一步阅读[基础工作流](https://eidograph-docs.metaphorprojects.link/usage/basics),了解文件、导出、设置和应用内 Agent。 继续阅读:[安装 Eidograph](https://eidograph-docs.metaphorprojects.link/guide/installation) · [账户与 Pro](https://eidograph-docs.metaphorprojects.link/guide/account-and-pro) · [平板触控](https://eidograph-docs.metaphorprojects.link/guide/tablet-quick-start) --- URL: https://eidograph-docs.metaphorprojects.link/guide/account-and-pro # 账户、免费额度与 Eidograph Pro 账户是可选的。退出登录时,2D/3D 几何、全部绘图工具、项目、撤销、多选以及 `.eido` 保存与打开仍然可用且不计量。登录用于同步经过服务器验证的 Pro 权益,并支持应用内购买。 ## 使用邮箱验证码登录 1. 打开**设置 › 账户**。 2. 输入邮箱地址并选择**发送验证码**。 3. 查看邮箱,把验证码输入应用后选择**登录**。 4. 登录成功后,账户页会显示邮箱、免费版/专业版状态与当前权益。 发送验证码后需要等待 60 秒才能再次发送。访问令牌会自动刷新;如果会话失效,应用会要求重新登录。选择**退出登录**会清除本机账户会话,但不会删除项目文件。 ## 免费版的每日额度 只有三类“离开应用或使用共享接口”的操作按本地自然日计数: | 功能 | 当前 production/test 配置 | 计数时机 | | --- | ---: | --- | | SVG / PNG / GIF / MP4 导出 | 5 次/天 | 一次导出成功时 | | 应用内 Agent 消息 | 5 条/天 | 发送一条用户消息时 | | MCP / REST 工具调用 | 25 次/天 | 外部客户端实际执行工具时 | 额度在设备本地午夜重置。工具发现和查看可用接口不计为 API 调用。具体发行版可以调整额度,因此**设置 › 账户**、导出对话框和 Agent 输入区显示的数字始终是当前安装版本的准确信息。 达到额度后,项目与几何编辑不会被锁住;只有对应的导出、消息或外部调用会暂停,直到次日重置或账户获得 Pro。 ## 购买 Pro Eidograph Pro 是一次性购买,不是订阅。登录后,如果当前平台和发行包启用了商店购买,账户页会显示**购买 Eidograph Pro**: - Windows 使用 Microsoft Store 的耐久型附加产品; - Android 使用 Google Play 一次性商品。 商店返回的购买凭据会提交给 Eidograph Token Server 验证。客户端不会仅凭商店弹窗成功就自行授予权益;只有服务器账户状态中的 `pro` 权益才会解锁无限额度。 ## 在其他设备恢复权益 在另一台设备上安装正式版后,使用购买时关联的同一个 Eidograph 邮箱账户登录,然后在**设置 › 账户**选择**刷新状态**。服务器验证过的 Pro 权益随 Eidograph 账户生效,不要求在每台设备重复购买。 如果商店显示已拥有但账户仍为免费版: 1. 确认登录的是原来的 Eidograph 邮箱账户; 2. 确认 Microsoft Store / Google Play 使用购买时的商店账户; 3. 检查网络并选择**刷新状态**; 4. 不要在 test 与 production 环境之间比较权益; 5. 仍未恢复时,记录应用版本、平台、购买时间和订单信息后联系支持。 ## 离线状态 成功取得的账户状态会缓存在本机。短期网络故障不会在使用过程中撤销已知的 Pro 权益;应用至多每天在后台重新检查一次。登录、首次购买和未关联权益的恢复仍需要联网。 --- URL: https://eidograph-docs.metaphorprojects.link/guide/tablet-quick-start # 平板触控快速上手 Eidograph 的画布使用统一的指针事件,触控、手写笔和鼠标遵循同一构造逻辑。平板上可以不连接键盘完成绘图、选择、多选、动画与保存。 ## 先调整界面 1. 横屏启动以获得更宽的画布和右侧面板。 2. 拖动右侧面板分隔线调整宽度;面板内部的分隔线可调整图形列表高度。 3. 文字过小时,在**设置 › 外观 › 字体大小**选择 L 或 XL。该设置只缩放界面,不改变画布或导出尺寸。 4. 暂时不需要脚本时可以折叠右侧面板,集中使用画布。 ## 基本手势 | 手势 | 2D 画布 | 3D 画布 | | --- | --- | --- | | 单指点按 | 选择对象或放置工具控制点 | 选择对象或放置 3D 控制点 | | 拖动自由点 | 在平面中移动并写回坐标 | 在面向相机的平面中移动 | | 拖动绑定点 | 沿承载路径移动 | 沿线性承载对象或球面移动 | | 拖动空白 | 平移画布 | 环绕相机 | | 双指捏合/移动 | 以两指中点缩放并平移 | 缩放并调整视图 | | 长按对象 | 进入触控多选 | 进入触控多选 | 第二根手指在绘图或拖动过程中落下时,当前单指操作会安全取消并转为双指视图手势。 ## 一笔创建对象 选择线段、直线、射线或圆等两点工具后,可以按下放置第一个点,拖动查看预览,松开时完成第二个点。也可以逐点轻触。圆弧与椭圆需要三个控制点,按界面预览依次完成。 开启**此项目 › 画布与缩放 › 拖动时自动吸附**后: - 靠近已有点会吸附到该点坐标,但新点仍保持自由; - 靠近路径会改写为绑定点,之后只能沿路径拖动; - 释放前目标会高亮,可在不合适时把手指移开。 ## 触控多选和批量编辑 长按画布对象或**对象**面板中的一行约半秒,会把它加入选择并进入粘性多选模式。之后轻触其他对象即可继续切换选择,不必按修饰键。 选择两个或更多对象后,画布底部出现“已选 N 项”工具条: - **复制**/**粘贴**:把选择复制到当前或其他图形([详情](https://eidograph-docs.metaphorprojects.link/usage/editing-objects#%E5%A4%8D%E5%88%B6%E4%B8%8E%E7%B2%98%E8%B4%B4%E5%AF%B9%E8%B1%A1)); - **编辑…**:批量设置颜色、不透明度、隐藏状态等共享属性; - **删除**:同时删除选中对象及依赖它们的对象; - **×**:清除选择并退出多选。 轻触空白或按 Escape 也会清除选择。多选轻触不会误触发拖动。 ## 使用参数与动画 打开**参数**标签即可拖动脚本中每个 `param` 的滑块;松开时数值写回脚本。画布状态栏的播放、暂停和停止按钮控制 `animate`;停止会把当前动画值写回文本。 ## 保存与恢复 完成一次练习后,从项目标签选择**保存**,把项目写为 `.eido`。测试新版本或卸载应用前,使用**另存为**把重要文件放到明确可找到的位置。可以从[示例项目](https://eidograph-docs.metaphorprojects.link/examples/)下载现成 `.eido`,在平板上练习拖动与参数操作。 --- URL: https://eidograph-docs.metaphorprojects.link/usage/basics # 基础工作流 ## 项目、图形与脚本 Eidograph 的工作区可以同时打开多个项目。项目显示为顶部标签,一个项目内部可以有任意数量的 2D 平面图形与 3D 立体图形。图形类型在创建时确定;切换图形时,应用会装载对应的画布与工具。 每个图形只有一个事实来源:Eidolang 脚本。画布工具会追加命令,拖动会改写数值字面量,参数滑块也会把最终值写回文本。因此可以自由混合三种编辑方式: - 用工具快速搭建构造; - 直接拖动自由点或路径上的绑定点; - 在编辑器中精确修改命令与表达式。 **对象**面板列出名称、类型、自由度和当前状态;**诊断**区域给出脚本错误、警告、行号和修复提示。遇到错误时先修复最早的一条,后续错误往往会随之消失。 ## 文件管理 一个 `.eido` 文件就是一个完整项目。它是基于 ZIP 的当前格式(manifest `version: 2`),内部脚本保持为纯 UTF-8 文本。保存项目时会包含图形顺序、名称、2D/3D 类型以及该项目自己的画布与缩放设置。 默认不把 Agent 聊天写入文件;需要共享对话时,在**设置 › 常规 › 包含 Agent 聊天**中开启。摄像机角度、平移缩放和选择状态属于本机视图状态,不进入项目文件。 ## 导出图形 点击左侧工具栏底部的**导出**,选择格式与范围: | 格式 | 2D 平面 | 3D 立体 | 适合场景 | | --- | --- | --- | --- | | SVG | 原生矢量图 | 当前视角的线框/轮廓投影 | 排版、网页和后续矢量编辑 | | PNG | 支持透明背景与 1×/2×/4× | WebGL 画布像素输出 | 演示、聊天和普通图片 | | GIF | 按动画或阶段时间线导出 | 时间线或相机环绕 | 展示动态关系 | | MP4 | 按动画或阶段时间线导出 | 时间线或相机环绕 | 长片段、高分辨率播放与视频剪辑 | 范围可选择**当前视图**或**适合内容**;2D 还可以在画布上框选自定义区域。坐标网格、透明背景、像素倍率和 动画帧率可以逐次调整,也可以在设置中修改默认值。 ## 常用设置 - **外观**:浅色/深色/跟随系统、界面语言和文字缩放。 - **画布与缩放(默认)**:只影响之后创建的新项目。 - **此项目 › 画布与缩放**:随 `.eido` 保存,只影响当前项目。 - **导出默认值**:决定导出对话框的初始值。 - **Agent**:保存模型端点并选择当前模型。 - **MCP / REST 服务器**:控制原生应用的端口、监听范围、工具权限与活动记录。 ## 应用内 Agent 基础使用 1. 打开**设置 › Agent**,添加模型的提供商、Base URL、API 密钥和模型 ID。 2. 回到右侧 **Agent** 标签,输入“创建一个三角形并标出三边中点”之类的请求。 3. 展开每个工具调用,检查参数、结果和脚本修改。 4. 如果结果不合适,使用该轮下方的**回退本轮**;它会尽量保留你在之后做的手动修改。 Agent 默认跟随当前项目。长任务开始前可以将它**固定**到项目,避免查看其他标签时改变编辑目标。Agent 修改会经过与手动编辑相同的编译、诊断、持久化与撤销流程。 **Warning** 模型端点必须允许应用的 WebView 发起跨域请求(CORS)。Windows 和 Android 应用会把 API 密钥存入系统保护的凭据存储。 深入阅读:[项目与文件](https://eidograph-docs.metaphorprojects.link/usage/projects-and-files) · [对象编辑](https://eidograph-docs.metaphorprojects.link/usage/editing-objects) · [动画与 GIF/MP4](https://eidograph-docs.metaphorprojects.link/usage/animation-and-export) · [3D 使用](https://eidograph-docs.metaphorprojects.link/usage/solid-3d) · [设置参考](https://eidograph-docs.metaphorprojects.link/usage/settings) --- URL: https://eidograph-docs.metaphorprojects.link/usage/projects-and-files # 项目、图形与文件工作流 Eidograph 的层级是“工作区 → 项目 → 图形”。顶部每个标签是一个打开的项目;一个项目对应一个 `.eido` 文件,并可包含任意数量的 2D 或 3D 图形。每个图形是一份 Eidolang 脚本。 ## 新建项目 点击顶部 **+**,选择: - **新建项目 — 2D 图形**:项目中带一个平面图形; - **新建项目 — 3D 图形**:项目中带一个立体图形; - **空项目**:不含图形,稍后从图形面板或 Agent 创建。 点击项目标签可切换;点击当前标签打开项目操作,可重命名、保存、另存为或关闭。项目名在保存后以实际 `.eido` 文件名为准。 ## 管理图形 在右侧**图形**面板中: - 使用 **+ 2D** 或 **+ 3D** 添加图形; - 点击行切换当前图形; - 使用铅笔按钮重命名; - 使用 × 删除,确认后无法通过普通撤销恢复; - 实心/空心圆点控制该图形是否暴露给 Windows MCP/REST 客户端。 图形在创建时固定为 `plane` 或 `solid`。修改脚本中的 `space` 为另一种类型只会产生诊断,不会转换图形;请新建目标类型图形并迁移构造。 当 Agent 固定到某个项目并正在工作时,该项目的图形新增、删除与切换会被锁定,以避免中途改变目标。 ## 保存、另存为和关闭 - **保存**:第一次选择目标路径,之后覆盖同一文件。 - **另存为**:选择新文件名和位置,并把项目名同步为文件名。 - `Ctrl/⌘ S`:保存;`Ctrl/⌘ Shift S`:另存为。 - **关闭**:只从工作区移除标签,不删除磁盘上的 `.eido`。有未保存修改时会要求确认。 `.eido` 是 ZIP 容器,manifest 当前固定为 `version: 2`,内部每个图形仍是纯文本脚本。它保存项目名、图形顺序/名称/类型以及项目自己的画布与缩放设置。默认不含 Agent 对话;需要时先开启**设置 › 常规 › 包含 Agent 聊天**。 相机姿态、2D 平移缩放、网格样式与选择状态是本机视图状态,不进入 `.eido`。 ## 打开与拖放导入 点击顶部文件夹按钮,或把文件拖到应用窗口: | 文件 | 结果 | | --- | --- | | `.eido` | 作为新的项目标签打开 | | `.zip` | 按当前 `.eido` 包结构读取,作为新项目打开 | | `.geo` / `.txt` | 作为新图形加入当前项目 | 裸脚本优先读取 `space plane` 或 `space solid`。没有 `space` 行时,应用会询问以 2D 还是 3D 打开。`.eido` 永远不会合并进当前项目。 ## 导出单个脚本 通过命令面板选择**保存 Eidolang (.txt)**,可以把当前图形导出为纯文本。它只包含一个图形,不含项目设置或其他图形;适合代码审阅和版本控制,但完整分享应使用 `.eido`。 ## 推荐备份方式 1. 工作过程中定期保存项目。 2. 在升级、切换测试/生产轨道或卸载前使用**另存为**建立外部副本。 3. 需要分享对话时才打开“包含 Agent 聊天”,并先检查提示中是否有敏感内容。 4. 用另一个标签重新打开备份,确认图形数量、类型和脚本无误。 --- URL: https://eidograph-docs.metaphorprojects.link/usage/editing-objects # 对象属性、多选、撤销与命令面板 Eidograph 中所有可视化编辑最终都是脚本编辑。属性弹窗、拖动、多选批量修改和 Agent 调用都会进入同一份图形撤销历史。 ## 打开对象属性 指针工具激活时,点按画布对象会选择它,并在默认设置下打开属性弹窗。还有两条始终可用的路径: - 在 Windows 上右键对象; - 点按右侧**对象**面板中的对象行。 如果不希望普通点按弹出属性,可关闭**设置 › 常规 › 点击打开属性**。关闭后点按仍会选中对象并跳到对应脚本行,右键与对象面板仍能打开弹窗。 ## 可编辑属性 | 分组 | 内容 | | --- | --- | | 位置/值 | 自由点坐标、绑定参数、局部坐标或 `param` 值;派生对象没有可写自由度 | | 外观 | 颜色、不透明度、线宽;2D 还包括填充与实线/虚线/点线 | | 标签 | 普通文字或完整 `$$…$$` LaTeX 公式 | | 文本框 | 2D 文本、宽高、字号和文本颜色 | | 可见性 | 隐藏/显示对象,隐藏对象仍留在对象面板中 | 提交后,应用会更新或追加对应的 `style`、`label`、`hide` 等命令。每次提交是一个撤销步骤。 删除对象时,确认框会列出依赖它的对象。删除会同时移除依赖链,避免留下引用不存在名称的脚本行。 ## 多选 - Windows:按住 `Ctrl`、`Shift` 或 `⌘`(适用键盘)并点击画布对象/对象行以切换选择。 - 触控或手写笔:长按约半秒进入粘性多选,之后普通点按即可继续切换。 选择两个或更多对象后,画布底部出现批量工具条。**编辑…**可一次修改共享的描边、透明度与隐藏状态;删除会移除全部选中对象及依赖对象。一次批量提交只占一个撤销步骤。 按 `Escape`、点击空白或使用工具条 × 清空选择。`Delete`/`Backspace` 删除当前选择。 ## 复制与粘贴对象 可以把一个或多个对象复制到同一图形、其他图形、另一个已打开的项目或另一个应用窗口: 1. 选中对象(见上方多选)。 2. 按 `Ctrl/⌘ C`,或点按底部选择工具条中的**复制**。 3. 切换到目标图形,按 `Ctrl/⌘ V`,或点按工具条中的**粘贴**。 复制会连同选中对象所依赖的一切(祖先点、线和宏)以及它们的样式与标签一起带走,因此粘贴后的副本仍然是活的构造,行为与原对象一致。动画与分段(stage)不会被复制。 粘贴时,与目标图形中已有名称冲突的对象会被重命名(`A` → `A2`),状态栏会列出重命名结果。一次粘贴只占一个撤销步骤,粘贴出的对象成为新的选择。若副本来自另一种方言(2D 粘到 3D 或反之),或粘贴会引入脚本错误,则粘贴会被拒绝。 `Ctrl/⌘ C` 会把副本以纯 Eidolang 文本放入系统剪贴板,因此也可以粘贴到脚本编辑器或其他应用中。工具条中的**复制**/**粘贴**使用应用内副本,触控设备无需剪贴板权限:没有选中对象时,工具条会显示**粘贴 N 个对象**,直到用 × 丢弃。 ## 撤销与重做 撤销历史属于当前图形,而不是整个项目: - `Ctrl/⌘ Z`:撤销; - `Ctrl/⌘ Shift Z` 或 `Ctrl Y`:重做; - 左侧工具栏与命令面板也提供相同操作。 包含在历史中的操作有脚本输入、画布工具创建、拖动提交、属性修改、参数滑块、Agent 工具调用和批量编辑。切换到另一个图形后,会使用那个图形自己的历史。 删除图形本身不属于图形脚本历史,因此删除确认后不能靠 `Ctrl Z` 恢复;重要图形应先保存项目。 ## 命令面板 按 `Ctrl/⌘ K` 或点击顶部 `⌘K` 打开命令面板。输入关键词可查找: - 绘图工具与当前快捷键; - 撤销、重做、导出与保存脚本; - 保存/另存为、设置、新建项目/图形和打开 `.eido`; - 当前 2D/3D 方言的全部 Eidolang 命令签名; - 已配置 Agent 时,把输入内容直接作为请求发送。 选择一个语言命令会把模板插入 Eidolang 编辑器,适合在不记得完整签名时继续填写。精确语法也可查阅 [Eidolang 参考](https://eidograph-docs.metaphorprojects.link/eidolang/reference)。 --- URL: https://eidograph-docs.metaphorprojects.link/usage/animation-and-export # 参数、动画、阶段演示与 GIF/MP4 导出 Eidograph 把动画定义在 Eidolang 中,而不是保存为独立的画布状态。2D、3D、阶段播放与 GIF/MP4 导出使用同一条时间线,因此屏幕播放和导出帧保持一致。 ## 参数滑块 ```txt param r 1 range 0.5 4 step 0.1 circle c O radius r ``` 每个 `param` 会出现在右侧**参数**面板。拖动时图形实时重算,松开时当前值写回 `param` 命令。没有声明 `range` 的参数不会获得完整的可调范围。 ## 连续动画 ```txt animate r duration 2s mode pingpong ``` 动画目标必须是参数或具有可写自由度的绑定对象。支持: - `mode loop`:循环回到开头; - `mode pingpong`:在两端往返; - `mode once`:播放一次; - `speed` 或 `duration`:控制速度/时长; - `over t0 t1`:限制变化区间。 状态栏的播放/暂停控制预览;**停止**会把当前动画值写回脚本字面量,成为可撤销的编辑。 ## 阶段演示 `stage` 把构造组织成连续步骤: ```txt stage givens duration 1.2s reveal fade point A -3 0 point B 3 0 segment base A B stage result duration 1.2s reveal draw point M = midpoint(A, B) hide base transition erase duration 0.6s ``` - 第一条 `stage` 之前的对象是始终存在的背景。 - `reveal cut|fade|draw` 控制该阶段新对象的出现方式。 - `clear` 隐藏之前阶段引入的可见对象,但不会删除依赖图中的值。 - `show`/`hide` 可选择 `cut`、`fade`、`draw`/`erase` 与独立时长。 出现阶段脚本后,状态栏提供上一阶段、播放/暂停、重置、下一阶段和完整时间轴。编辑时默认显示最终完成状态;从末尾播放会重新从第一阶段开始。 ## 导出 GIF 与 MP4 打开当前图形的**导出**对话框并选择 GIF 或 MP4: 1. 选择**当前视图**或**适合内容**;2D 还可以框选自定义区域。 2. 决定是否包含坐标网格。 3. 选择像素倍率、帧率,以及预设或自定义时长;默认值来自**设置 › 导出默认值**。 4. 有 `stage` 时导出阶段时间线;普通 `animate` 脚本导出一次完整运动。 5. 3D 还可以选择相机环绕模式。 两种格式使用同一条时间线渲染同样的帧,区别只在编码方式。时长最初来自脚本时间线,但导出对话框可以用预设值或自定义秒数覆盖。为防止内存过大,应用会限制总帧数;超出时导出对话框会显示已封顶。降低帧率、时长或像素倍率可以减小文件。 ### 该选 GIF 还是 MP4 | | GIF | MP4 | | --- | --- | --- | | 编码 | 调色板,每帧最多 256 色 | H.264,全彩 | | 文件大小 | 随时长和细节迅速增大 | 相同时长与倍率下明显更小 | | 播放 | 凡是能显示图片的地方都会自动循环 | 需要视频播放器;长片段或高分辨率也保持流畅 | | 适合 | 聊天、论坛、问题追踪 | 幻灯片、视频剪辑、课程录制 | MP4 的注意事项: - 视频没有声音,也不支持透明;两种动画格式都不显示透明背景开关。 - H.264 要求像素尺寸为偶数,因此奇数的导出宽高会向上取整 1 像素。 - 编码使用系统的 H.264 编码器。若系统无法在所选尺寸下编码 H.264,导出会报错,此时仍可使用 GIF。 ## 让动画稳定 - 动画参数,而不是已经派生出来的对象。 - 确保整个范围内构造都有效,例如圆弧端点不要在中途重合。 - 数值求交或复杂曲面使用适中的 samples,避免每帧计算过重。 - 导出前从头播放一次并检查诊断;警告对象可能在部分帧消失。 - 需要在演示末尾保留某一姿态时,停止播放让当前值写回,再保存项目。 --- URL: https://eidograph-docs.metaphorprojects.link/usage/solid-3d # 3D 相机、交互与立体导出 3D 图形使用透视相机和 WebGL 渲染,但几何世界坐标不会因视角改变。旋转、缩放与视角恢复只影响观察方式,不改写 Eidolang 对象。 ## 相机控制 - 在空白区域拖动:环绕当前相机目标。 - 滚轮或双指捏合:向指针附近缩放。 - 平移视图:鼠标右键拖动,或按住 Shift / Ctrl 再用左键拖动;触屏上用双指同时移动。相机与环绕中心一起移动。 - 点按角落方向轴:弹出视图菜单。**重置视图**让目标回到原点并恢复初始距离;选中对象时还会出现**环绕选中对象**,它把环绕中心移到所选对象的中心(视线方向与距离不变),之后旋转都围绕该对象进行。 - 角落方向轴显示世界 x/y/z,其中 z 轴向上。 相机位置与目标在切换图形时保存在本机视图状态,返回图形时恢复;它们不写入 `.eido`。缩放距离受当前项目的 3D 最小/最大视距限制。 ## 选择与拖动 3D 点 指针工具下,点按对象进行选择。拾取优先级是点、线性对象、表面/实体,因此透明球体内部的点仍可选择。 - 自由 `point3` 在面向相机的平面中拖动; - 绑定点沿 segment3/line3/ray3 移动; - 球面绑定点沿球面移动; - 派生点不能直接拖动。 开启自动吸附后,自由点靠近已有点会坐标吸附,靠近线性承载对象或球面会改写成绑定点。目标在释放前高亮。 ## 3D 绘图工具 Point3 在世界 `z = 0` 地面上放置点;按下后竖直拖动可创建非零 z 坐标。Segment3、Sphere、Cylinder、Cone 等工具通过已有点或新控制点构造对象,并显示虚线/线框预览。状态栏的 **落点 z** 按钮可设置新点落下的高度:输入数值、回到地面 (0),或取选中点的 z。网格会升到该高度,x/y 轴仍留在 `z = 0`。 展开「线性对象」可选择「空间直线」(`L`),点选两个位置不同的点;展开「平面图形与截面」可选择「平面」,点选三个不共线的点。点击没有点的位置会在落点平面(**落点 z** 的高度,默认 z = 0)上或附近对象上新建一个点,并随构造一起写入;需要不在地面上的点时,可先用 Point3 创建或抬高。点选支持 Backspace 撤回、Esc 取消;创建成功后可一次撤销。 所建直线可作为「旋转」工具的轴线,平面可作为「平面截面」工具的截平面。长方体、棱柱、棱锥与棱台归入「多面体」,圆柱、圆锥与圆台归入「柱锥台体」,球及其部分归入「球与球体部分」。更多工具的分类与点选顺序见[几何构造](https://eidograph-docs.metaphorprojects.link/eidolang/constructions)。也可从 [3D 示例项目](https://eidograph-docs.metaphorprojects.link/examples/)开始修改。 ## 自适应网格和尺寸 网格步长随相机距离按 1-2-5 级数调整,角落图例显示当前单位。地面网格没有边界:平移时跟随视野,并向地平线逐渐淡出。无限直线和平面的显示范围也随视距增长。点、交点标记和标签保持近似恒定的屏幕尺寸,因此远近视图仍容易点击。 ## 3D PNG PNG 读取当前 WebGL 渲染结果: - **当前视图**保留实时相机构图; - **适合内容**保留观察方向,但临时居中并后退相机以容纳完整模型; - 可选 1×/2×/4× 像素倍率; - 可关闭地面网格与方向轴; - 3D 始终渲染背景,不支持透明背景。 ## 3D SVG 3D SVG 不是画布截图。Eidograph 从当前评估模型和相机重新生成线框/轮廓投影:线与曲线成为投影折线,实体输出边线和解析轮廓,曲面输出等参网格,并带半透明面填充。 当前没有隐藏线消除;对象按深度近似排序,因此复杂重叠模型可能与实体 WebGL 画面不同。SVG 适合示意图和矢量排版,不是工程制图投影。 ## 3D GIF 与 MP4 GIF 与 MP4 可以使用脚本的 `animate`/`stage` 时间线,也可以自动环绕相机。**适合内容**会在不改变已保存相机的前提下围绕模型建立临时导出相机。导出完成后交互视角保持不变。两种格式渲染同样的帧;相同环绕时长下 MP4 的文件明显更小。 若文件太大,请降低帧率、像素倍率或动画时长;曲面 samples 较高时也会明显增加逐帧渲染成本。 --- URL: https://eidograph-docs.metaphorprojects.link/usage/settings # 设置完整参考 设置分为**应用**级偏好和**此项目**设置。应用偏好影响整个工作区并保存在本机;项目设置随 `.eido` 文件保存。不要把“画布与缩放(默认)”与当前项目的“画布与缩放”混为一谈。 ## 应用 › 常规 - **包含 Agent 聊天**:保存 `.eido` 时加入当前项目的会话;默认关闭。分享前检查提示和附件内容。 - **点击打开属性**:开启时点按画布对象直接弹出属性;关闭时只选择,右键和对象面板仍可打开。 - **重置所有偏好**:恢复外观、导出、Agent、服务器和新项目画布默认值。不会改变已打开项目自己的画布设置或几何脚本。 ## 应用 › 外观 - **颜色主题**:深色、浅色、跟随系统。 - **语言**:跟随系统,或选择应用支持的语言;Eidolang 关键字不翻译。 - **字体大小**:S/M/L/XL(约 85%–130%),只缩放标题栏、工具栏、面板和对话框,不改变画布与导出。 ## 应用 › 画布与缩放(默认) 这些值只在**创建新项目时复制一次**: - 2D 最小/最大缩放与网格目标像素间距; - 3D 最小/最大相机距离与网格密度; - 拖动时自动吸附。 修改后不会追溯影响现有项目。要改当前项目,请使用“此项目”分组。 ## 应用 › MCP / REST 服务器 Windows 应用中的原生外部接口设置: - 开启/关闭服务器、端口(默认 `14159`); - 仅本机或允许同一局域网客户端; - MCP 地址、Trae/WorkBuddy 配置复制; - 每个工具的独立允许列表; - 最近最多 200 条外部调用活动。 LAN 模式没有身份验证,只能在可信网络使用。每个图形是否暴露由**图形**面板中的圆点单独控制。更多见 [Agent 集成](https://eidograph-docs.metaphorprojects.link/agents/integration)。 ## 应用 › 账户 邮箱验证码登录、免费版/Pro 状态、今日额度、刷新状态、退出登录以及平台商店购买。完整说明见[账户、免费额度与 Pro](https://eidograph-docs.metaphorprojects.link/guide/account-and-pro)。 ## 应用 › Agent - 显示/隐藏应用内 Agent 标签; - 保存多个模型并选择当前模型; - 提供商:OpenAI-compatible、Anthropic、Google Gemini/Vertex; - 每个模型包含名称、Base URL、API 密钥和模型 ID; - 可从端点获取模型列表,也可手动输入 ID。 Windows 与 Android 应用把 API 密钥放入系统保护的安全存储,模型的非敏感元数据保存在偏好中。删除模型会同时删除对应密钥。 ## 应用 › 导出默认值 - PNG/GIF/MP4 栅格倍率:1×、2× 或 4×; - 2D SVG/PNG 默认透明背景; - 动画帧率(GIF 与 MP4):5–50 fps。 这些只是导出对话框的初始值,每次导出仍可覆盖。动画时长(GIF 与 MP4)最初来自脚本时间线,并可在导出对话框中用预设或自定义秒数覆盖。坐标网格也有保存的默认状态,并可在导出时调整。 ## 此项目 › 画布与缩放 与默认页相同的 2D/3D 限制、网格参数与自动吸附,但只属于当前项目,并写入 `.eido` manifest: - 2D 缩放限制和自动吸附立即应用; - 3D 视距限制在下次重新打开/切换图形时应用; - **重置此项目**会复制当前应用默认值,不影响其他项目。 ## 关于 显示当前应用版本、项目网站和支持邮箱。报告问题时请附上版本、平台、test/production 环境、复现步骤以及相关 `.eido`(确认可分享后)。 ## 哪些设置会随文件移动 | 内容 | 随 `.eido` | 只留本机 | | --- | --- | --- | | 项目画布/缩放与自动吸附 | 是 | — | | 图形脚本、名称与类型 | 是 | — | | Agent 聊天 | 可选 | 默认只在本机 | | 主题、语言、字体大小 | 否 | 是 | | 导出默认值与 Agent 模型 | 否 | 是 | | API 密钥与账户会话 | 否 | 是(安全存储/会话存储) | | 相机姿态、平移缩放、选择 | 否 | 是(视图状态) | | MCP/REST 端口、工具允许与图形暴露 | 否 | 是 | --- URL: https://eidograph-docs.metaphorprojects.link/components/overview # 绘图组件概览 Eidograph 中的“组件”是 Eidolang 构造对象。对象通过名称引用,修改上游对象后,所有派生对象会按依赖关系实时重新计算。 ## 自由、绑定与派生 每个对象都属于一个自由度层级: | 层级 | 示例 | 交互方式 | | --- | --- | --- | | 自由(橙色) | `point A 0 0` | 可直接拖动;坐标会写回脚本 | | 绑定(紫色) | `point P on c at 0.25` | 只能沿承载路径拖动;参数会写回 | | 派生(灰色) | `point M = midpoint(A, B)` | 不能直接拖动;通过输入对象改变 | 这套规则对 2D 与 3D 一致,也是判断“为什么这个点不能拖动”的第一依据。 ## 平面组件 ### 点与线性对象 ```txt space plane point A -3 -1 point B 3 -1 segment base A B point M = base.mid perpendicular p M base ``` 常用线性对象包括 `segment`、`line`、`ray`、`vector`、平行线和垂线。点既可以自由放置,也可以绑定在线段、圆、曲线等路径上。 ### 圆、圆弧、椭圆与多边形 ```txt circle c M through A point P on c at 45deg arc a A P B polygon tri A P B label P text "P" ``` 这些对象都是可继续引用的构造结果。圆、椭圆、多边形可以转为区域并参与并集、交集和差集;不同路径可以求交点。 ### 函数图形与动态组件 `plot`、`curve`、`polar`、`equation` 和 `locus` 会生成路径。`param` 提供可调参数,`animate` 让参数或绑定对象随时间变化,`stage` 把构造组织为顺序演示。 ```txt param r 2 range 0.5 4 circle c M radius r animate r duration 2s mode alternate ``` ## 立体组件 3D 图形以 `space solid` 开始。基础对象包括 `point3`、`segment3`、`vector3`、平面、球、圆,以及盒体、棱柱、棱锥、圆柱和圆锥;还可使用空间曲线、轨迹、坐标架和函数曲面。 ```txt space solid point3 O 0 0 0 point3 T 0 0 3 sphere s O radius 2 cylinder body O T radius 1 ``` 指针工具用于旋转相机;选中对象仍会在对象面板中显示类型、状态与可编辑属性。3D SVG 是从当前视角重新生成的线框/轮廓投影,并不是 WebGL 画布截图。 ## 样式、标签与组合 `style` 控制颜色、线宽、透明度、填充和 2D 线型;`label` 给对象添加文字或完整的 `$$…$$` LaTeX 公式;`textbox` 在 2D 画布上放置可换行文本框。`group` 可以让多个对象共同隐藏、显示或设置样式。 对象属性弹窗是编辑这些命令的可视化入口。无论从弹窗还是脚本修改,结果都是普通的文本编辑,因此可以撤销,也能被 Agent 读取。 --- URL: https://eidograph-docs.metaphorprojects.link/eidolang/reference # Eidolang 语言参考 Eidolang 是 Eidograph 图形的文本表示。一个图形就是一份脚本:命令创建对象,表达式建立依赖,样式和动画仍然写在同一份文本中。画布上的拖动、工具操作与属性修改最终都会写回这份脚本。 本页只描述当前语言(Eidolang `0.2`),不包含已废弃语法。需要可直接运行的完整脚本时,请前往[示例项目](https://eidograph-docs.metaphorprojects.link/examples/)。 ## 脚本骨架 每个脚本应以空间声明开始: ```txt space plane version 0.2 # 一行一条命令;# 后是注释 point A -2 0 point B 2 0 segment base A B point M = midpoint(A, B) ``` - `space plane` 使用 2D 平面方言,`space solid` 使用 3D 立体方言。 - `version 0.2` 可选;它是语言版本,不是 `.eido` manifest 版本。 - 名称区分大小写,必须先定义后使用。 - 角度字面量默认是弧度;角度数值应明确写成 `45deg`。 - 字符串使用双引号,颜色可使用 `#3366cc` 形式。 ## 自由度模型 每个几何对象恰好属于一种层级: | 层级 | 定义 | 行为 | | --- | --- | --- | | 自由 | 坐标或数值直接写为字面量 | 可以拖动或通过属性面板修改 | | 绑定 | 用 `on … at …` 或局部坐标绑定到承载对象 | 只能沿承载对象移动 | | 派生 | 使用 `=` 表达式从其他对象计算 | 不能直接拖动;输入变化时自动更新 | ```txt point A 0 0 # 自由 point P on c at 0.25 # 绑定 point M = midpoint(A, P) # 派生 ``` ## 通用值与表达式 标量表达式支持 `+ - * / ^`、括号、比较和布尔运算。常量包括 `pi`、`tau` 与 `e`;常用函数包括 `sin`、`cos`、`tan`、`sqrt`、`abs`、`min`、`max` 和距离/向量函数。 对象属性可以继续参与表达式,例如 `base.length`、`c.radius`、`poly.area`。`let` 保存任意表达式值,`fn` 定义可供绘图或曲面使用的函数: ```txt let half = base.length / 2 fn wave(x) = sin(x) * half plot graph wave domain -6 6 ``` 无效值不会让应用崩溃:诊断会指出源代码位置和原因,下游对象会标记为无效或警告状态。 ## 平面(2D)命令 ### 构造基础对象 | 组件 | 常用形式 | | --- | --- | | 点 | `point A x y`、`point P on path at t`、`point M = expr` | | 线性对象 | `segment s A B`、`line l A B`、`ray r A B`、`vector v A B` | | 圆 | `circle c O radius r`、`circle c O through A` | | 椭圆与圆弧 | `ellipse e F1 F2 through P`、`arc a P1 P2 P3` | | 多边形 | `polygon tri A B C` | | 标准构造 | `midpoint M A B`、`parallel p A l`、`perpendicular p A l` | | 交点 | `intersections xs pathA pathB` | 交点结果是 `list`。优先用稳定选择器,例如 `xs.nearest(A)`、`xs.maxY` 或 `xs.minX`;`xs[0]` 的排序可能在运动过程中变化。 ### 路径、函数与区域 ```txt plot graph sin domain -6 6 curve loop (cos(t), sin(t)) t from 0 to tau samples 160 polar rose (2*cos(3*a)) a from 0 to tau equation unit x^2 + y^2 = 1 locus trace P driver u samples 180 region disk = c region lens = intersection(c1, c2) ``` `segment`、`line`、`ray`、`circle`、`ellipse`、`arc`、函数图形和轨迹都实现 Path 行为,可承载绑定点、参与求交,也可用 `subpath` 和 `pathjoin` 组合。 ### 变换与坐标架 ```txt point Q = reflect(P, axis) rotate tri2 tri around O by 30deg translate c2 c by (2, -1) scale big tri around O by 2 frame f O X point L in f 1 0.5 ``` `reflect`、`rotate`、`translate` 和 `scale` 既有表达式函数,也有命令形式。相似变换会尽量保留对象类型。 ## 立体(3D)命令 ```txt space solid point3 O 0 0 0 point3 T 0 0 3 sphere ball O radius 2 cylinder body O T radius 1 ``` | 组件 | 常用形式 | | --- | --- | | 点与线 | `point3`、`segment3`、`line3`、`ray3`、`vector3` | | 平面与球 | `plane ground A B C`、`sphere s O radius r` | | 实体 | `box`、`prism`、`pyramid`、`cylinder`、`cone` | | 坐标架 | `frame3 f O X Y`、`point3 P in f x y z` | | 空间曲线 | `curve3`、`locus3` | | 函数曲面 | `surface waves f domain x0 x1 y0 y1` | | 求交 | `intersections3`、`plane_intersect_line`、`sphere_intersect_sphere` | | 变换 | `reflect3`、`rotate3`、`translate3`、`scale3` | 3D 中可以把点绑定在线段、直线、射线或球面上。球面点使用两个参数: ```txt point3 P on ball atAngles 45deg 90deg ``` `box`、`prism`、`pyramid`、`cylinder` 和 `cone` 提供 `.volume`、`.surfaceArea` 与 `.centroid` 等度量。`curve3` 与 `locus3` 是采样显示对象,目前不能作为绑定点的承载路径。 ## 参数、动画与演示阶段 ```txt param r 1 range 0.5 4 step 0.1 circle c O radius r animate r duration 2s mode pingpong stage result duration 1.2s reveal draw show c transition draw duration 0.8s ``` - `param` 会在参数面板生成滑块。 - `animate` 支持 `loop`、`pingpong` 和 `once`。 - `stage` 创建顺序演示步骤;`show`、`hide`、`clear` 与 reveal 方式控制出现和移除。 - 2D、3D 播放和 GIF/MP4 导出共享同一时间线。 ## 表现层命令 ```txt style base stroke #3366cc width 2 opacity 0.9 label base text "given segment" textbox note -4 3 width 5 height 2 text "Drag A or B" group helpers A B base hide helpers transition fade duration 0.5s ``` `style` 可设置颜色、填充、线宽、透明度、点/箭头尺寸;2D 还支持虚线。完整包在 `$$…$$` 中的 label 文本会按 LaTeX 排版。`textbox` 仅用于 2D。 ## 宏与断言 ```txt def bisect(A, B) -> (M, b) { midpoint M A B perpendicular_bisector b A B } use bisect P Q -> M1 b1 assert dist(P, M1) == dist(M1, Q) tolerance 1e-6 note "M1 is midpoint" ``` `def`/`use` 用于复用构造,展开时会隔离内部名称。`assert` 只检查关系并产生警告,不会约束或求解图形。 ## 在应用内查询完整签名 本页按功能组织常用命令。需要当前方言的精确完整签名时,可以: - 在 Eidolang 编辑器中使用 **help**; - 让应用内 Agent 调用 `list_commands`; - 让外部 MCP/REST 客户端调用同名工具。 这样返回的列表直接来自当前解析器命令注册表,会与已安装版本保持一致。 ## 新增对象 切线、圆锥曲线、Bézier、样条、不等式区域,以及空间曲线、面、截面、生成实体与参数/隐式曲面的完整语法,见[新增几何构造](https://eidograph-docs.metaphorprojects.link/eidolang/constructions.md)。 --- URL: https://eidograph-docs.metaphorprojects.link/eidolang/constructions # 新增几何构造 这些对象可以通过脚本创建,在 App 与 Viewer 中显示,并随输入点、参数及动画更新。名称仍需唯一;`e`、`sphere`、`surface` 等常量或命令名不能作为对象名。 ## 工具箱 App 左侧工具箱中的新增工具均按步骤点选画布或「对象」列表中的现有对象,命令面板也会激活同样的工具。已选对象高亮显示;误选类型会被忽略。当前步骤需要点时,点击没有点的位置会新建一个点,吸附规则与基础绘图工具一致:附近有点就复用,点在曲线上或附近则新建绑定在该曲线上的点,否则新建自由点(3D 中吸附到附近对象,或落在落点平面上——默认 `z = 0`,可在状态栏的 **落点 z** 修改)。新建的点会立即显示,但只在构造完成时才与构造一起写入脚本;当前步骤需要的不是点时,点击空白不会创建任何对象。Backspace 或「撤回上一步」撤回最后一次点选(包括由它新建的点),Esc 或「取消点选」清空未完成的构造,不修改脚本。创建前校验几何,成功后连同新建的点作为一次可撤销的脚本修改;移动所引用的对象会自动更新结果。 工具按几何类型和用途归组,分组提示显示类别名称,每组记住上次使用的工具。工具栏和命令面板使用同一份工具表,原有快捷键保持可用。 | 空间 | 类别 | 工具 | | --- | --- | --- | | 2D | 点与中心 | 点、内心、外心、垂心、重心 | | 2D | 线性对象 | 线段、向量、直线、射线 | | 2D | 辅助线 | 垂线、平行线、切线、法线、过点圆切线、角平分线 | | 2D | 圆与圆弧 | 圆、圆弧、三点圆、内切圆 | | 2D | 圆锥曲线 | 椭圆、抛物线、双曲线 | | 2D | 曲线 | Bézier、样条 | | 2D | 多边形与区域 | 正多边形、扇形、弓形、不等式区域 | | 3D | 线性对象 | 空间线段、向量、直线 | | 3D | 空间圆与曲线 | 空间圆、圆弧、椭圆 | | 3D | 平面图形与截面 | 平面、空间多边形、平面截面 | | 3D | 多面体 | 长方体、棱柱、棱锥、多面体、棱台 | | 3D | 柱锥台体 | 圆柱、圆锥、圆台 | | 3D | 球与球体部分 | 球、球缺、半球、球带、球扇形 | | 3D | 生成构造 | 拉伸、旋转 | | 3D | 数学曲面 | 参数曲面、隐式曲面 | 指针、3D 点工具和 2D 文本框保留独立入口。「空间直线」(快捷键 `L`)点选两个位置不同的已有点,创建 `line3`;「平面」点选三个不共线的已有点。需要时先用 Point3 创建或抬高点。所建直线可用作旋转轴,平面可用作截平面;移动输入点时构造自动更新,支持撤回点选及一次撤销。 | 工具 | 点选顺序 | | --- | --- | | 切线/法线 | 曲线、点(取该点在曲线上的投影位置) | | 过点圆切线 | 圆、圆外点 | | 角平分线 | 点、顶点、点;再选择内角/外角 | | 三点圆、内切圆、三角形中心 | 三个三角形顶点 | | 抛物线 | 焦点、准线(直线、线段或射线) | | 双曲线 | 第一焦点、第二焦点、曲线上一点 | | Bézier、样条 | 依次选控制点,Enter 或「完成」结束;Bézier 选满四点也会完成 | | 正多边形 | 中心、顶点;再设置边数 | | 扇形、弓形 | 中心、起始半径点、结束方向点(逆时针) | | 空间直线/平面 | 两个位置不同的点/三个不共线的点 | | 空间圆、圆弧 | 三个点;圆弧的中间点为经过点 | | 空间椭圆 | 中心、长轴端点、短轴测量点;第三点确定所在平面,到长轴的垂距确定第二半径 | | 空间多边形、多面体 | 依次点选顶点/多边形面,Enter、「完成」或再次点选第一个对象结束 | | 平面截面 | 立体、截平面 | | 圆台 | 底面中心、底面半径点、顶面中心、顶面半径点 | | 棱台 | 底面多边形、顶面中心、顶面半径点(相对底面第一个顶点的中心距离确定比例) | | 拉伸 | 轮廓、表示位移的向量或线段 | | 旋转体 | 轮廓、旋转轴直线(整周旋转) | | 球冠、半球、球带、球扇形 | 球体、法向向量/线段/直线/射线/平面;球冠和球扇形再选截平面上的点,球带再选两个截平面上的点,半球不需要截取点 | | 不等式、隐式曲面、参数曲面 | 两个范围角点,再输入数学表达式 | 多边形与 Bézier 至少选三个点,样条至少两个点,多面体至少四个面。样条完成时可选择是否闭合。定义域由两角点的 x/y 坐标确定,隐式曲面还使用 z;参数曲面的 x/y 分别对应 u/v。 ## 2D | 对象 | 语法 | | --- | --- | | 外接圆、内切圆 | `circumcircle cc A B C`、`incircle ic A B C` | | 内/外角平分线 | `angle_bisector bis A V B [external]` | | 切线、法线 | `tangent t path at 0.5`、`normal n path at 0.5` | | 从点引圆切线 | `tangents pair c from P`,返回直线列表 | | 抛物线 | `parabola p F directrix l [from -10] [to 10]`;`l` 可为直线、线段或射线,线段/射线按其所在直线计算 | | 双曲线 | `hyperbola h F1 F2 through P [from -3] [to 3]` | | Bézier | `bezier b P0 P1 P2 [P3]` | | 正多边形 | `regular_polygon hex O V sides 6` | | 插值样条 | `spline s A B C [closed]` | | 扇形、弓形 | `sector s O radius 2 from 0 to 90deg`、`circular_segment cap O radius 2 from 0 to 90deg` | | 不等式区域 | `inequality r (x^2+y^2 <= 4) domain -3 3 -3 3` | `incenter(A,B,C)`、`circumcenter(A,B,C)`、`orthocenter(A,B,C)`、`centroid(A,B,C)` 返回三角形的内心、外心、垂心、重心。 新曲线支持 `point(t)`、`project(P)`、`param(P)`、`tangent(t)`、`.length`、点绑定、求交与动画。Bézier 的参数范围是 `[0,1]`;样条用控制点区间索引加比例。双曲线显示两个分支,合并参数 `[0,1)` 对应左支、`[1,2]` 对应右支,在 `1` 处跳转;`h.left`、`h.right` 分别使用原始双曲参数,适合单支连续动画。 扇形、弓形是不带点绑定的区域对象,提供精确 `.area`、`.contains(P)` 与 `.arc` 路径。不等式区域被裁剪到 `domain`,面积和边界为采样近似。多个约束用 `intersection` 合并。 ## 3D ```txt space solid point3 O 0 0 0 point3 A 3 0 0 point3 B 0 2 0 circle3 orbit O normal (0,0,1) radius 2 arc3 arc O normal (0,0,1) radius 2 from 0 to 90deg ellipse3 ellipse O normal (0,0,1) radii 3 2 ellipse3 oriented O normal (cross3(vec3(O,A),vec3(O,B))) axis (vec3(O,A)) radii 3 2 polygon3 base (0,0,0) (4,0,0) (4,4,0) (0,4,0) extrude body base by (0,0,3) plane slicing (0,0,1) normal (0,0,1) section cut body by slicing point3 P on orbit at 0 animate P duration 4s ``` `ellipse3` 可用 `axis <向量>` 代替 `angle` 指定第一轴方向,向量在所在平面上的投影必须非零;两种子句不能同时使用。 `circle3 c A B C`、`arc3 a A B C` 也支持三点定义。圆弧经过中间点。`polygon3` 支持凹多边形;`polygon3 ring outer holes inner` 支持带孔面。所有顶点必须共面,边界不能自交或互相接触。 | 对象 | 语法与结果 | | --- | --- | | 自定义多面体 | `polyhedron s face1 face2 face3 face4 ...`,面为 `polygon3`,每条边属于两个面 | | 截面 | `section cut s by pl`,多面体返回带面积、边界的 `polygon3`,球返回 `circle3` | | 圆台 | `frustum f baseCenter topCenter radii 2 1` | | 棱台 | `pyramid_frustum f baseFace top topCenter scale 0.5` | | 挤出体 | `extrude s profile by (0,0,3) [samples 96]`,支持带孔面、圆和椭圆 | | 旋转面/体 | `revolve s profile around axis [from 0] [to 2pi] [samples 64]` | | 参数曲面 | `parametric_surface s (u,v,u*v) domain -2 2 -2 2 [samples 48]` | | 隐式曲面 | `equation3 s (x^2+y^2+z^2-4) domain -3 3 -3 3 -3 3 [samples 32]` | 旋转曲线生成曲面,旋转简单多边形生成封闭实体;旋转轴必须在生成面的平面内,生成面须位于轴的一侧,暂不接受带孔生成面。部分旋转会封闭两端。`equation3` 绘制表达式等于零的曲面,因此一般方程写成左边减右边。 `curve3`、`locus3`、空间圆/圆弧/椭圆和多边形边界现在都支持: ```txt point3 P on helix at 0.5 let Q = helix.project(A) let t = helix.param(A) let direction = helix.tangent(0.5) animate P duration 4s mode pingpong ``` `curve3` 使用精确表达式求点,`locus3` 在连续采样段内插值;未定义间隙保持无效,不会连线穿越。字面量 `at` 支持拖动、动画和保留角度单位的源码写回。球面仍用两个 `atAngles` 参数。参数曲面提供 `s.point(u,v)`、`s.normal(u,v)`,暂不作为绑定点的曲面载体。 多面体截面、面面积和多边形挤出测量使用实际几何;球截圆、圆台测量使用解析公式。圆柱/圆锥截面的曲线边界、圆/椭圆挤出、旋转体及曲面面积使用网格近似。没有面积的截切返回空列表与警告。 参数曲面采样限制为每轴 8–160,隐式曲面为 8–64;旋转体限制为 30,000 个生成顶点,隐式网格限制为 250,000 个顶点。Viewer 的求值预算比编辑器更小,高采样脚本可能超出预算。 ## 球的部分实体 ```txt sphere_cap cap ball normal (0,0,1) height 1 samples 32 hemisphere half ball normal (0,0,1) samples 32 sphere_zone band ball normal (0,0,1) from -1 to 1 samples 32 sphere_sector radial ball normal (0,0,1) height 1 samples 32 ``` `ball` 是已有球,`normal` 指向正轴。球冠高度满足 `0 < height <= 2r`;半球使用高度 `r`。球带是两个轴向位置之间的球体切片,满足 `-r <= from < to <= r`。球扇形将球冠的球面部分沿半径连接到球心。显示网格复用旋转生成,体积、总表面积、重心、高度和球面部分面积 `.curvedArea` 使用精确公式。总表面积包含封闭所需的底面或锥面。采样默认 32,限制为 8–96。 --- URL: https://eidograph-docs.metaphorprojects.link/examples/objects-2d # 2D 对象图鉴 每个主题都是一个可以直接打开的独立项目,包含完整、可编辑的 Eidolang 源码。预览图由同一份源码通过实际运行时渲染;它是初始状态,完整交互请打开项目。 在 Eidograph 中使用顶部的**打开**或拖入下载文件,之后可以拖动自由点、调整参数并用**另存为**保存自己的版本。**在查看器中打开**可直接在浏览器查看;Viewer 用于观察与播放,编辑请使用已安装的应用。 也可以查看 [3D 对象图鉴](https://eidograph-docs.metaphorprojects.link/examples/objects-3d)、[基础示例](https://eidograph-docs.metaphorprojects.link/examples/)和[动画示例](https://eidograph-docs.metaphorprojects.link/examples/animations)。 ## 点与线性对象 对比自由点 A、B、绑定点 P 与派生中点 M,以及线段、直线、射线、向量、平行线和垂线。拖动 A 或 B,观察依赖对象一起更新。 ![点与线性对象](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-lines.png) [下载 2d-lines.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-lines.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-lines.eido) **完整 Eidolang 源码** ```txt space plane # Free, bound and derived points; four kinds of linear objects. point A -3 -1 point B 1 1 segment base A B point P on base at 0.35 midpoint M A B line axis (-3,3) (1,3) ray beam (-3,-3) (1,-2) vector arrow (2,-1) (4,1) parallel offset (0,2) base perpendicular upright B base style offset stroke #8b949e dash 6 4 style upright stroke #8b949e dash 6 4 label base text "segment" label axis text "line" label beam text "ray" label arrow text "vector" ``` ## 三角形、圆与中心 一个三角形同时展示外接圆、内切圆、内心、外心、垂心、重心和内角平分线。拖动三个顶点,对比各个中心的移动方式。 ![三角形、圆与中心](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-triangle.png) [下载 2d-triangle.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-triangle.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-triangle.eido) **完整 Eidolang 源码** ```txt space plane # Drag A, B or C to update circles, centers and the angle bisector. point A -3 -2 point B 3 -2 point C -1 3 polygon triangle A B C circumcircle outer A B C incircle inner A B C point I = incenter(A,B,C) point O = circumcenter(A,B,C) point H = orthocenter(A,B,C) point G = centroid(A,B,C) angle_bisector bis B A C style triangle fill #4c8dff opacity 0.2 style outer stroke #8b949e dash 6 4 style inner stroke #3fb68b width 2 style bis stroke #d9a53f label I text "incenter" label O text "circumcenter" label H text "orthocenter" label G text "centroid" ``` ## 圆、圆弧与圆锥曲线 并排展示圆、三点圆弧、焦点椭圆、焦点与准线定义的抛物线、双曲线,以及圆上的切线和法线。灰色虚线标出辅助法线。 ![圆、圆弧与圆锥曲线](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-conics.png) [下载 2d-conics.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-conics.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-conics.eido) **完整 Eidolang 源码** ```txt space plane circle round (-5,2) radius 1.3 arc bow (-6,-2) (-5,-1) (-4,-2) ellipse oval (-1,2) (1,2) through (0,2.7) point F 4 2 line directrix (3,0) (5,0) parabola bowl F directrix directrix from -2 to 2 hyperbola branches (-1,-3) (1,-3) through (0.6,-3) from -1.3 to 1.3 tangent touch round at 45deg normal radial round at 45deg style touch stroke #d9a53f style radial stroke #8b949e dash 6 4 label round text "circle" label bow text "arc" label oval text "ellipse" label bowl text "parabola" label branches text "hyperbola" ``` ## Bézier 与插值样条 四个控制点定义三次 Bézier,灰色线段显示两端控制柄;下方的样条经过给定点,中间还有闭合样条。拖动 A、B、C、D 或绑定点 P,观察曲线与切线、法线。 ![Bézier 与插值样条](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-smooth-curves.png) [下载 2d-smooth-curves.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-smooth-curves.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-smooth-curves.eido) **完整 Eidolang 源码** ```txt space plane point A -4 1 point B -2 4 point C 1 -1 point D 4 2 bezier cubic A B C D segment handleA A B segment handleB C D spline interpolated (-4,-2) (-2,-1) (0,-3) (2,-1) (4,-2) spline closedLoop (-1,1) (0,2.5) (1,1) (0,0) closed point P on cubic at 0.5 tangent touch cubic at 0.5 normal radial cubic at 0.5 style handleA stroke #8b949e dash 6 4 style handleB stroke #8b949e dash 6 4 style interpolated stroke #3fb68b width 2 style closedLoop stroke #b58cf2 width 2 style touch stroke #e0447c style radial stroke #8b949e dash 6 4 label cubic text "Bezier" label interpolated text "spline" label closedLoop text "closed spline" ``` ## 多边形与填充区域 展示正六边形、三角形、扇形、弓形、两个圆的交集和不等式区域。前两行的形状可用精确几何构造;不等式按定义域采样。 ![多边形与填充区域](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-regions.png) [下载 2d-regions.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-regions.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-regions.eido) **完整 Eidolang 源码** ```txt space plane # Domain corners also keep the sampled regions inside the initial fitted view. point domainMin 2.5 -3.5 point domainMax 5.5 3.5 hide domainMin hide domainMax regular_polygon hex (-4,2) (-2.5,2) sides 6 polygon tri (0,1) (2,1) (1,3) sector wedge (4,1.5) radius 1.6 from 0 to 120deg circular_segment cap (-4,-2) radius 1.6 from 0 to 140deg circle leftDisk (-0.6,-2) radius 1.3 circle rightDisk (0.6,-2) radius 1.3 region lens = intersection(leftDisk,rightDisk) inequality patch ((x-4)^2+(y+2)^2 <= 1.8) domain 2.5 5.5 -3.5 -0.5 style hex fill #d9a53f opacity 0.65 style tri fill #4c8dff opacity 0.6 style wedge fill #3fb68b opacity 0.6 style cap fill #e0447c opacity 0.6 style lens fill #b58cf2 opacity 0.8 style patch fill #5bbcbf opacity 0.7 label hex text "regular polygon" label wedge text "sector" label cap text "circular segment" label lens text "intersection" label patch text "inequality" ``` ## 函数、参数、极坐标与隐式曲线 同一画布上对比函数图像、李萨如参数曲线、极坐标玫瑰线和隐式椭圆。调整参数 a 改变上方正弦图像的振幅;更多动态练习见[函数与方程](https://eidograph-docs.metaphorprojects.link/examples/functions)。 ![函数、参数、极坐标与隐式曲线](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-plots.png) [下载 2d-plots.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-plots.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-plots.eido) **完整 Eidolang 源码** ```txt space plane param a 1 range 0.5 1.5 fn wave(x) = a*sin(x)+2.5 plot graph wave domain -5 5 curve loop (-3+1.4*cos(t),-1+sin(2*t)) t from 0 to 2pi samples 120 polar rose (1.5*cos(3*t)) t from 0 to 2pi samples 180 equation oval (x-3)^2/2+(y+1)^2 = 1 domain 1 5 -3 1 label graph text "plot" label loop text "parametric curve" label rose text "polar curve" label oval text "implicit equation" ``` ## 路径片段、路径连接与轨迹 红色粗线是圆的一段 subpath,下方绿色折线由 pathjoin 连接两个线段,右侧紫色圆是动点 Q 的 locus。调整 u,观察 P 与 Q 一起沿各自路径运动。 ![路径片段、路径连接与轨迹](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-paths.png) [下载 2d-paths.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-paths.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-paths.eido) **完整 Eidolang 源码** ```txt space plane param u 0.7 range 0 2pi circle carrier (-2,0) radius 2 subpath highlight carrier from 20deg to 140deg point P on carrier at u point Q = translate(P,(4,0)) locus trail Q driver u samples 100 segment link P Q segment first (-4,-3) (0,-3) segment second (0,-3) (2,-2) pathjoin route first second hide first hide second style carrier stroke #8b949e dash 6 4 style highlight stroke #e0447c width 4 style trail stroke #b58cf2 width 2 style route stroke #3fb68b width 3 label highlight text "subpath" label trail text "locus" label route text "pathjoin" ``` ## 坐标架、变换与标注 坐标架驱动蓝色三角形,同时展示旋转、平移、缩放的结果,以及直角标记、等长刻线、标签和文本框。拖动 X 改变坐标架方向与尺度。 ![坐标架、变换与标注](https://eidograph-docs.metaphorprojects.link/images/examples/objects/2d-frames-and-labels.png) [下载 2d-frames-and-labels.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-frames-and-labels.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/2d-frames-and-labels.eido) **完整 Eidolang 源码** ```txt space plane point O -3 -1 point X -1 -1 frame local O X point A in local 0 0 point B in local 1 0 point C in local 1 1 polygon original A B C rotate turned original around O by 60deg translate shifted original by (5,0) scale enlarged original around O by 1.6 mark right A B C segment lower A B segment side B C mark tick lower mark tick side label shifted text "translate" hide A hide B textbox note -4 4 width 8 height 1.5 text "Drag X to change the local frame. Marks and labels follow the geometry." style original stroke #4c8dff fill #4c8dff opacity 0.65 style turned stroke #3fb68b fill #3fb68b opacity 0.4 style shifted stroke #e0447c fill #e0447c opacity 0.4 style enlarged stroke #d9a53f opacity 0.5 ``` --- URL: https://eidograph-docs.metaphorprojects.link/examples/objects-3d # 3D 对象图鉴 每个主题都是一个可以直接打开的独立项目,包含完整、可编辑的 Eidolang 源码。预览图由同一份源码通过实际运行时渲染;它是初始状态,完整交互请打开项目。 在 Eidograph 中使用顶部的**打开**或拖入下载文件,之后可以拖动自由点、调整参数并用**另存为**保存自己的版本。**在查看器中打开**可直接在浏览器查看;Viewer 用于观察与播放,编辑请使用已安装的应用。 也可以查看 [2D 对象图鉴](https://eidograph-docs.metaphorprojects.link/examples/objects-2d)、[基础示例](https://eidograph-docs.metaphorprojects.link/examples/)和[动画示例](https://eidograph-docs.metaphorprojects.link/examples/animations)。 含无限直线或平面的范例,请在 Viewer 中先点击**重置视图**,再环绕或缩放查看有限对象。 ## 空间点、线、平面与坐标架 组合 point3、segment3、line3、ray3、vector3、三点平面、空间三角形和 frame3 绑定点。打开后环绕相机,查看同一组对象的空间位置。 ![空间点、线、平面与坐标架](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-lines-and-planes.png) [下载 3d-lines-and-planes.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-lines-and-planes.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-lines-and-planes.eido) **完整 Eidolang 源码** ```txt space solid point3 O -2 -1 0 point3 X 0 -1 0 point3 Y -2 1 0 frame3 local O X Y point3 P in local 0.5 0.5 1 segment3 leg O P vector3 arrow (1,-1,0) (2,0,2) line3 axis (-3,2,0) (1,2,1) ray3 beam (1,1,0) (2,1,1) plane sheet O X Y polygon3 triangle (1,-2,0) (3,-2,0) (2,-2,2) style sheet stroke #4c8dff fill #4c8dff opacity 0.12 style triangle stroke #3fb68b fill #3fb68b opacity 0.55 label P text "frame point" label leg text "segment3" label arrow text "vector3" label axis text "line3" label beam text "ray3" ``` ## 空间圆、椭圆与曲线 前排展示不同法向的圆、圆弧、椭圆,后排展示螺旋参数曲线和空间轨迹。P 绑定在螺旋线上;调整 u 让 Q 沿紫色轨迹移动。 ![空间圆、椭圆与曲线](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-space-curves.png) [下载 3d-space-curves.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-space-curves.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-space-curves.eido) **完整 Eidolang 源码** ```txt space solid circle3 orbit (-3,0,1) normal (0,0,1) radius 1.4 arc3 bow (0,0,1) normal (0,1,0) radius 1.4 from 0 to 140deg ellipse3 oval (3,0,1) normal (0,1,1) radii 1.6 0.8 curve3 helix (1.2*cos(t),4+1.2*sin(t),t/3) t from 0 to 4pi samples 120 point3 P on helix at 2pi param u 1 range 0 2pi point3 Q = (-3+cos(u),4+sin(u),1+0.5*sin(2*u)) locus3 trail Q driver u samples 100 style helix stroke #e0447c width 2 style trail stroke #b58cf2 width 2 label orbit text "circle3" label bow text "arc3" label oval text "ellipse3" label helix text "curve3" label trail text "locus3" ``` ## 多面体家族 并排展示长方体、三棱柱、四棱锥、棱台,以及由四个三角形面组合的自定义四面体。辅助底面与各个独立面隐藏后,保留完整实体供观察。 ![多面体家族](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-polyhedra.png) [下载 3d-polyhedra.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-polyhedra.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-polyhedra.eido) **完整 Eidolang 源码** ```txt space solid box block (-5,-2,0) dims 2 2 2 prism wedge (-1,-2,0) (1,-2,0) (0,0,0) extrude (0,0,2) pyramid peak (3,-2,0) (5,-2,0) (5,0,0) (3,0,0) apex (4,-1,2.5) polygon3 base (-5,3,0) (-3,3,0) (-3,5,0) (-5,5,0) pyramid_frustum truncated base top (-4,4,2) scale 0.5 hide base polygon3 faceA (-1,3,0) (1,3,0) (0,5,0) polygon3 faceB (-1,3,0) (0,4,2) (1,3,0) polygon3 faceC (1,3,0) (0,4,2) (0,5,0) polygon3 faceD (0,5,0) (0,4,2) (-1,3,0) polyhedron tetra faceA faceB faceC faceD hide faceA hide faceB hide faceC hide faceD style block stroke #4c8dff fill #4c8dff opacity 0.45 style wedge stroke #3fb68b fill #3fb68b opacity 0.45 style peak stroke #e0447c fill #e0447c opacity 0.45 style truncated stroke #d9a53f fill #d9a53f opacity 0.5 style tetra stroke #b58cf2 fill #b58cf2 opacity 0.5 label block text "box" label wedge text "prism" label peak text "pyramid" label truncated text "pyramid frustum" label tetra text "polyhedron" ``` ## 圆柱、圆锥与圆台 三个实体共用高度参数 h,半径保持不变。调整 h,对比圆柱、圆锥和圆台的外形;环绕相机查看上下底面与侧面。 ![圆柱、圆锥与圆台](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-round-solids.png) [下载 3d-round-solids.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-round-solids.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-round-solids.eido) **完整 Eidolang 源码** ```txt space solid param h 2.5 range 1.5 3.5 cylinder tube (-4,0,0) (-4,0,h) radius 1 cone peak (0,0,0) apex (0,0,h) radius 1.3 frustum taper (4,0,0) (4,0,h) radii 1.3 0.65 style tube stroke #4c8dff fill #4c8dff opacity 0.55 style peak stroke #3fb68b fill #3fb68b opacity 0.55 style taper stroke #e0447c fill #e0447c opacity 0.55 label tube text "cylinder" label peak text "cone" label taper text "frustum" ``` ## 球与球体部分 从左到右是完整球、球冠、半球、球带和球扇形。后四个都由同半径的隐藏参考球构造,便于比较截平面封闭、球面部分和连接球心的锥面。 ![球与球体部分](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-sphere-parts.png) [下载 3d-sphere-parts.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-sphere-parts.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-sphere-parts.eido) **完整 Eidolang 源码** ```txt space solid sphere ball (-6,0,1.2) radius 1.2 sphere capSource (-3,0,1.2) radius 1.2 sphere halfSource (0,0,1.2) radius 1.2 sphere bandSource (3,0,1.2) radius 1.2 sphere radialSource (6,0,1.2) radius 1.2 sphere_cap cap capSource normal (0,0,1) height 0.8 samples 16 hemisphere half halfSource normal (0,0,1) samples 16 sphere_zone band bandSource normal (0,0,1) from -0.5 to 0.5 samples 16 sphere_sector radial radialSource normal (0,0,1) height 0.8 samples 16 hide capSource hide halfSource hide bandSource hide radialSource style ball stroke #4c8dff fill #4c8dff opacity 0.55 style cap stroke #3fb68b fill #3fb68b opacity 0.6 style half stroke #e0447c fill #e0447c opacity 0.6 style band stroke #d9a53f fill #d9a53f opacity 0.6 style radial stroke #b58cf2 fill #b58cf2 opacity 0.6 label ball text "sphere" label cap text "cap" label half text "hemisphere" label band text "zone" label radial text "sector" ``` ## 带孔面的拉伸与截面 将带方孔的平面多边形向上拉伸,粉色截面保留内部孔洞。调整 h 移动截平面,观察截面始终落在实体内;可以在源码中改变拉伸向量。 ![带孔面的拉伸与截面](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-extrusion-and-section.png) [下载 3d-extrusion-and-section.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-extrusion-and-section.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-extrusion-and-section.eido) **完整 Eidolang 源码** ```txt space solid param h 1.5 range 0.5 2.5 polygon3 outer (-2,-2,0) (2,-2,0) (2,2,0) (-2,2,0) polygon3 hole (-1,-1,0) (1,-1,0) (1,1,0) (-1,1,0) polygon3 ring outer holes hole extrude hollow ring by (0,0,3) plane slicing (0,0,h) normal (0,0,1) section cut hollow by slicing hide outer hide hole hide ring style hollow stroke #4c8dff fill #4c8dff opacity 0.25 style slicing stroke #d9a53f fill #d9a53f opacity 0.1 style cut stroke #e0447c fill #e0447c opacity 0.8 label cut text "section with a hole" ``` ## 旋转曲面与部分旋转实体 左侧线段绕直线整周旋转生成曲面,右侧封闭多边形旋转 270° 生成带封口的实体。黄色线段是生成曲线;旋转轴仍显示以便理解构造。 ![旋转曲面与部分旋转实体](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-revolution.png) [下载 3d-revolution.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-revolution.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-revolution.eido) **完整 Eidolang 源码** ```txt space solid line3 axis (-3,0,0) (-3,0,1) segment3 profile (-1.7,0,0) (-2.2,0,3) revolve skin profile around axis samples 24 polygon3 panel (2.5,0,0) (4,0,0) (3.5,0,2.5) (2.5,0,2.5) line3 secondAxis (2,0,0) (2,0,1) revolve body panel around secondAxis from 0 to 270deg samples 24 hide panel style skin stroke #3fb68b fill #3fb68b opacity 0.5 style body stroke #e0447c fill #e0447c opacity 0.5 style profile stroke #d9a53f width 3 label skin text "revolved curve" label body text "partial revolved solid" ``` ## 函数曲面、参数曲面与隐式曲面 从左到右是二元函数曲面、参数方程定义的环面,以及隐式方程定义的椭球。调整 a 改变波浪振幅。范例使用适中的采样数,可以直接在 Viewer 中查看。 ![函数曲面、参数曲面与隐式曲面](https://eidograph-docs.metaphorprojects.link/images/examples/objects/3d-surfaces.png) [下载 3d-surfaces.eido](https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-surfaces.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/objects/3d-surfaces.eido) **完整 Eidolang 源码** ```txt space solid param a 0.7 range 0.3 1.2 fn wave(x,y) = a*(sin(x+5)+cos(y))+1.5 surface graph wave domain -7 -3 -2 2 samples 12 parametric_surface torus ((1+0.35*cos(v))*cos(u),(1+0.35*cos(v))*sin(u),1.5+0.35*sin(v)) domain 0 2pi 0 2pi samples 12 equation3 ellipsoid ((x-5)^2/2+y^2+(z-1.5)^2-1) domain 3 7 -1.5 1.5 0 3 samples 12 style graph stroke #4c8dff fill #4c8dff opacity 0.55 style torus stroke #3fb68b fill #3fb68b opacity 0.55 style ellipsoid stroke #e0447c fill #e0447c opacity 0.55 label graph text "function surface" label torus text "parametric surface" label ellipsoid text "implicit surface" ``` --- URL: https://eidograph-docs.metaphorprojects.link/examples/ # 基础 [2D 对象图鉴](https://eidograph-docs.metaphorprojects.link/examples/objects-2d) · [3D 对象图鉴](https://eidograph-docs.metaphorprojects.link/examples/objects-3d) 下面的项目可以直接下载并在 Eidograph 中打开。每个下载都是当前 `.eido` 格式(manifest `version: 2`),包含一份可编辑的 Eidolang 源码;没有旧格式或迁移数据。 下载后,点击应用顶部的**打开**按钮选择文件。也可以把 `.eido` 文件拖入应用,它会作为一个新的项目标签打开。 不想安装应用也可以:每个示例都提供**在查看器中打开**链接,直接在浏览器里打开该项目。 ## 正方形与中点构造(2D) 由两个自由点驱动一个始终保持为正方形的构造,并添加中点、旋转点、线段、直角/等长标记和动态断言。适合学习自由点、派生点、变换和 `assert`。 ```txt space plane point A -2 2 point B -2 -1 point C = rotate(A, B, -90deg) point D = translate(A, vec(B, C)) polygon square A B C D ``` [下载 square-abcd-midpoint-pq.eido](https://eidograph-docs.metaphorprojects.link/downloads/square-abcd-midpoint-pq.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/square-abcd-midpoint-pq.eido) ## 立体组件巡览(3D) 在一个项目中组合圆柱与螺旋线、圆锥、相似坐标架和由参数驱动的空间轨迹。适合快速查看常见 3D 对象与动画。 ```txt space solid point3 G 3 -3 0 point3 H 3 -3 2 cylinder tube G H radius 0.6 curve3 helix (3 + 0.8*cos(5*t), -3 + 0.8*sin(5*t), t) t from 0 to 2 samples 200 ``` [下载 solids-tour.eido](https://eidograph-docs.metaphorprojects.link/downloads/solids-tour.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/solids-tour.eido) ## 星形八面体(3D) 两个正四面体相互穿插形成星形八面体。单个参数控制整体大小,同时构造外接球、核心八面体和绕球面运动的点,并用断言持续检查几何关系。 ```txt space solid param s 1.4 range 0.6 2.4 point3 O 0 0 0 point3 A1 s s s point3 A2 s -s -s point3 A3 -s s -s point3 A4 -s -s s pyramid alpha A1 A2 A3 apex A4 ``` [下载 stella-octangula.eido](https://eidograph-docs.metaphorprojects.link/downloads/stella-octangula.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/stella-octangula.eido) ## 正弦与余弦函数曲面(3D) 用二元函数和 `surface` 命令绘制 `z = sin(x) + cos(y)`,参数滑块实时改变曲面振幅。适合学习 `fn`、函数曲面、采样与样式。 ```txt space solid param s 1 range 0.2 2.5 fn f(x, y) = s * (sin(x) + cos(y)) surface waves f domain -6 6 -6 6 samples 64 ``` [下载 surface-sincos.eido](https://eidograph-docs.metaphorprojects.link/downloads/surface-sincos.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/surface-sincos.eido) ## 修改示例 打开示例后可以直接拖动自由点、调整参数滑块,或在 Eidolang 编辑器中修改数值。使用**另存为**保存自己的副本。若要从头理解命令,请同时参阅 [Eidolang 语言参考](https://eidograph-docs.metaphorprojects.link/eidolang/reference)。 --- URL: https://eidograph-docs.metaphorprojects.link/examples/animations # 动画 下面每个示例都是一个独立的 `.eido` 项目,里面只有一个图形,用 `stage`、`animate` 和 `assert` 把一条几何结论演示出来。每个下载都是当前 `.eido` 格式(manifest `version: 2`),包含一份可编辑的 Eidolang 源码。 下载后,点击应用顶部的**打开**按钮选择文件,或者把 `.eido` 文件直接拖入应用。不想安装应用也可以用**在查看器中打开**链接,直接在浏览器里播放。 页面中的图片是用 Eidograph 的导出功能从同一个图形导出的 PNG,展示的是时间轴上的某一帧;完整动画请打开文件后播放。 ## 平面图形 ### 中垂线定理 这个示例展示如何制作动画来演示线段中垂线的性质。点 P 在中垂线上滑动,PA 与 PB 的实时长度标签始终相等,两条断言在每一帧检查距离相等和垂直关系。 ![中垂线定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/perpendicular-bisector-theorem.png) [下载 perpendicular-bisector-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-bisector-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-bisector-theorem.eido) ### 拿破仑定理 这个示例展示如何制作动画来演示拿破仑定理。顶点 C 不断变形三角形,而三个外接正三角形的中心始终构成一个正三角形。 ![拿破仑定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/napoleons-theorem.png) [下载 napoleons-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/napoleons-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/napoleons-theorem.eido) ### 泰勒斯定理 这个示例展示如何制作动画来演示泰勒斯定理。点 P 沿半圆移动,直径 AB 在 P 处所张的角始终是直角。 ![泰勒斯定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/thales-theorem.png) [下载 thales-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/thales-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/thales-theorem.eido) ### 圆周角定理 这个示例展示如何制作动画来演示圆周角定理。点 P 沿优弧移动,圆心角 AOB 始终是圆周角 APB 的两倍。 ![圆周角定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/inscribed-angle-theorem.png) [下载 inscribed-angle-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/inscribed-angle-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/inscribed-angle-theorem.eido) ### 垂径定理 这个示例展示如何制作动画来演示垂径定理。弦 AB 绕圆旋转,OM 始终与它垂直,两段半弦的长度标签始终相等。 ![垂径定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/perpendicular-chord-bisector-theorem.png) [下载 perpendicular-chord-bisector-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-chord-bisector-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/perpendicular-chord-bisector-theorem.eido) ### 等腰三角形的底角 这个示例展示如何制作动画来演示等腰三角形的底角相等。顶点 C 沿对称轴上下滑动,无论高度如何,两个底角始终相等。 ![等腰三角形的底角](https://eidograph-docs.metaphorprojects.link/images/examples/animations/isosceles-triangle-base-angles.png) [下载 isosceles-triangle-base-angles.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/isosceles-triangle-base-angles.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/isosceles-triangle-base-angles.eido) ### 三角形内角和 这个示例展示如何制作动画来演示三角形的内角和。过 C 作底边的平行线,把三个内角拼成一个平角,同时顶点 C 持续移动。 ![三角形内角和](https://eidograph-docs.metaphorprojects.link/images/examples/animations/triangle-angle-sum.png) [下载 triangle-angle-sum.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-angle-sum.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-angle-sum.eido) ### 三角形重心定理 这个示例展示如何制作动画来演示三角形的重心定理。三角形持续变形,三条中线始终交于 G,且 G 在每条中线上都保持 2:1 的分点比。 ![三角形重心定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/triangle-centroid-theorem.png) [下载 triangle-centroid-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-centroid-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-centroid-theorem.eido) ### 勾股定理的拼接证明 这个示例展示如何制作动画来演示勾股定理。四个全等直角三角形在同一个正方形内旋转到另一种摆法,把两个小正方形变成斜边上的一个正方形。 ![勾股定理的拼接证明](https://eidograph-docs.metaphorprojects.link/images/examples/animations/pythagorean-rearrangement-proof.png) [下载 pythagorean-rearrangement-proof.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/pythagorean-rearrangement-proof.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/pythagorean-rearrangement-proof.eido) ### 三角形的外心 这个示例展示如何制作动画来演示三角形的外心。三条边的中垂线始终交于 O,外接圆随着移动的顶点 C 一起变化。 ![三角形的外心](https://eidograph-docs.metaphorprojects.link/images/examples/animations/triangle-circumcenter.png) [下载 triangle-circumcenter.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-circumcenter.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/triangle-circumcenter.eido) ### 半径与切线 这个示例展示如何制作动画来演示半径与切线的垂直关系。切点 T 绕圆移动,切线始终与半径 OT 垂直。 ![半径与切线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/radius-and-tangent.png) [下载 radius-and-tangent.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/radius-and-tangent.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/radius-and-tangent.eido) ### 圆幂定理 这个示例展示如何制作动画来演示点对圆的幂。过 P 的一条割线不断旋转,实时标签显示两条割线的乘积始终相等。 ![圆幂定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/power-of-a-point.png) [下载 power-of-a-point.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/power-of-a-point.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/power-of-a-point.eido) ### 托勒密定理 这个示例展示如何制作动画来演示托勒密定理。顶点 D 沿圆滑动,两条对角线的乘积与两组对边乘积之和始终相等。 ![托勒密定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/ptolemys-theorem.png) [下载 ptolemys-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/ptolemys-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/ptolemys-theorem.eido) ### 平行四边形的对角线 这个示例展示如何制作动画来演示平行四边形对角线互相平分。夹角变化使平行四边形不断倾斜,两条对角线始终共用同一个中点 M。 ![平行四边形的对角线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/parallelogram-diagonals.png) [下载 parallelogram-diagonals.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/parallelogram-diagonals.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/parallelogram-diagonals.eido) ### 瓦里尼翁定理 这个示例展示如何制作动画来演示瓦里尼翁定理。顶点 D 不断变形四边形,而由四边中点连成的四边形始终是平行四边形。 ![瓦里尼翁定理](https://eidograph-docs.metaphorprojects.link/images/examples/animations/varignons-theorem.png) [下载 varignons-theorem.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/varignons-theorem.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/varignons-theorem.eido) ### 反射与最短折线 这个示例展示如何制作动画来演示反射得到的最短路径。点 P 沿镜面滑动,实时路径长度恰好在 A、P 和反射点 B' 共线时取到最小值。 ![反射与最短折线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/reflection-shortest-path.png) [下载 reflection-shortest-path.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/reflection-shortest-path.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/reflection-shortest-path.eido) ### 位似变换 这个示例展示如何制作动画来演示位似变换。比例系数 k 逐渐增大,每个像点始终落在从 O 出发的射线上,每条边长都乘以 k。 ![位似变换](https://eidograph-docs.metaphorprojects.link/images/examples/animations/homothety.png) [下载 homothety.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/homothety.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/homothety.eido) ### 旋转是刚体运动 这个示例展示如何制作动画来演示旋转作为刚体运动。三角形绕 O 转满一圈,断言在每一帧检查所有边长和角度都保持不变。 ![旋转是刚体运动](https://eidograph-docs.metaphorprojects.link/images/examples/animations/rotation-is-a-rigid-motion.png) [下载 rotation-is-a-rigid-motion.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/rotation-is-a-rigid-motion.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/rotation-is-a-rigid-motion.eido) ### 椭圆的焦点定义 这个示例展示如何制作动画来演示椭圆的焦点定义。点 P 绕椭圆走一圈,两条焦半径各自变化,但它们的和始终是常数。 ![椭圆的焦点定义](https://eidograph-docs.metaphorprojects.link/images/examples/animations/ellipse-focal-definition.png) [下载 ellipse-focal-definition.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/ellipse-focal-definition.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/ellipse-focal-definition.eido) ### 抛物线的焦点与准线 这个示例展示如何制作动画来演示抛物线的焦点准线定义。点 P 沿抛物线移动,它到焦点的距离始终等于它到准线的距离。 ![抛物线的焦点与准线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/parabola-focus-and-directrix.png) [下载 parabola-focus-and-directrix.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/parabola-focus-and-directrix.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/parabola-focus-and-directrix.eido) ### 缩放仪与相似 这个示例展示如何制作动画来演示缩放仪如何放大图形。连杆机构转动,两条轨迹分别记录描针和画笔的路径,画笔路径是按 k 放大的相似图形。 ![缩放仪与相似](https://eidograph-docs.metaphorprojects.link/images/examples/animations/pantograph-similarity.png) [下载 pantograph-similarity.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/pantograph-similarity.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/pantograph-similarity.eido) ### 滚动圆生成的摆线 这个示例展示如何制作动画来演示摆线。圆沿直线做无滑滚动,圆周上一个标记点把摆线作为轨迹画出来。 ![滚动圆生成的摆线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/cycloid-from-a-rolling-circle.png) [下载 cycloid-from-a-rolling-circle.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/cycloid-from-a-rolling-circle.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/cycloid-from-a-rolling-circle.eido) ### 单位圆与正弦曲线 这个示例展示如何制作动画来演示单位圆如何生成正弦曲线。一条连接线把圆上的转动点和图像上的点连起来,后者的高度正是同一个角的正弦值。 ![单位圆与正弦曲线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/unit-circle-and-sine-wave.png) [下载 unit-circle-and-sine-wave.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/unit-circle-and-sine-wave.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/unit-circle-and-sine-wave.eido) ### 圆反演 这个示例展示如何制作动画来演示关于圆的反演。点 P 沿射线向外移动时像点 P' 向内移动,乘积 OP × OP' 始终等于 R²。 ![圆反演](https://eidograph-docs.metaphorprojects.link/images/examples/animations/circle-inversion.png) [下载 circle-inversion.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/circle-inversion.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/circle-inversion.eido) ## 立体图形 ### 长方体的体对角线 这个示例展示如何制作动画来演示长方体的体对角线。高度不断增加,底面对角线和体对角线分别按 a² + b² 与 a² + b² + c² 被断言检查。 ![长方体的体对角线](https://eidograph-docs.metaphorprojects.link/images/examples/animations/cuboid-space-diagonal.png) [下载 cuboid-space-diagonal.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/cuboid-space-diagonal.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/cuboid-space-diagonal.eido) ### 圆锥与圆柱的体积比 这个示例展示如何制作动画来演示等底等高的圆锥与圆柱的体积比。两个立体共用的半径不断增大,实时体积标签始终保持 3:1 的比例。 ![圆锥与圆柱的体积比](https://eidograph-docs.metaphorprojects.link/images/examples/animations/cone-and-cylinder-volume-ratio.png) [下载 cone-and-cylinder-volume-ratio.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/cone-and-cylinder-volume-ratio.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/cone-and-cylinder-volume-ratio.eido) ### 两球的交线圆 这个示例展示如何制作动画来演示两个球面相交所成的圆。两球心的距离不断增大,公共圆随之缩小,并始终位于两球心连线的中垂面内。 ![两球的交线圆](https://eidograph-docs.metaphorprojects.link/images/examples/animations/intersection-circle-of-two-spheres.png) [下载 intersection-circle-of-two-spheres.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/intersection-circle-of-two-spheres.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/intersection-circle-of-two-spheres.eido) ### 星形八面体 这个示例展示如何制作动画来演示星形八面体。第二个全等正四面体持续旋转,到 90 度时两者互相穿插,中心留下一个正八面体内核。 ![星形八面体](https://eidograph-docs.metaphorprojects.link/images/examples/animations/stella-octangula.png) [下载 stella-octangula.eido](https://eidograph-docs.metaphorprojects.link/downloads/animations/stella-octangula.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/animations/stella-octangula.eido) --- URL: https://eidograph-docs.metaphorprojects.link/examples/functions # 函数与方程图像 下面每个示例都是一个独立的 `.eido` 项目,里面只有一个图形:画出一条函数曲线、参数曲线、极坐标曲线或隐式方程,再让式子里的参数动起来。每个下载都是当前 `.eido` 格式(manifest `version: 2`),包含一份可编辑的 Eidolang 源码。 下载后,点击应用顶部的**打开**按钮选择文件,或者把 `.eido` 文件直接拖入应用。不想安装应用也可以用**在查看器中打开**链接,直接在浏览器里播放。 页面中的图片是用 Eidograph 的导出功能从同一个图形导出的 PNG,打开了坐标网格,展示的是时间轴上的某一帧;完整动画请打开文件后播放,也可以自己拖动参数滑块。 ## 函数图像 ### 正弦曲线的参数 这个示例展示如何制作动画来演示 y = a·sin(b·x + c) 中三个参数对正弦波的作用。灰色虚线始终是 y = sin x,a、b、c 各自在一个 stage 里移动,橙色线段实时读出波峰的高度。 ![正弦曲线的参数](https://eidograph-docs.metaphorprojects.link/images/examples/functions/sine-wave-parameters.png) [下载 sine-wave-parameters.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/sine-wave-parameters.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/sine-wave-parameters.eido) ### 二次函数的顶点式 这个示例展示如何制作动画来演示二次函数的顶点式 y = a·(x − h)² + k。顶点是一个派生点,h 移动时用 locus 画出它的轨迹,断言检查曲线确实经过 (h, k)。 ![二次函数的顶点式](https://eidograph-docs.metaphorprojects.link/images/examples/functions/quadratic-vertex-form.png) [下载 quadratic-vertex-form.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/quadratic-vertex-form.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/quadratic-vertex-form.eido) ### 图像的平移与伸缩 这个示例展示如何制作动画来演示平移和伸缩对函数图像的作用。基准曲线上的一点用向量连到它的像,h、k、s 轮流移动。 ![图像的平移与伸缩](https://eidograph-docs.metaphorprojects.link/images/examples/functions/graph-transformations.png) [下载 graph-transformations.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/graph-transformations.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/graph-transformations.eido) ### 指数函数与它的反函数 这个示例展示如何制作动画来演示为什么 y = eˣ 与 y = ln x 的图像互为镜像。一个点沿指数曲线移动,把坐标交换后正好落在对数曲线上,两条断言检查关于 y = x 的对称关系。 ![指数函数与它的反函数](https://eidograph-docs.metaphorprojects.link/images/examples/functions/exponential-and-its-inverse.png) [下载 exponential-and-its-inverse.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/exponential-and-its-inverse.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/exponential-and-its-inverse.eido) ### 多项式的根与因式 这个示例展示如何制作动画来演示多项式的因式与图像交点之间的联系。中间的根沿 x 轴滑动,只带走一个交点,另外两个交点纹丝不动。 ![多项式的根与因式](https://eidograph-docs.metaphorprojects.link/images/examples/functions/polynomial-roots-and-factors.png) [下载 polynomial-roots-and-factors.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/polynomial-roots-and-factors.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/polynomial-roots-and-factors.eido) ### 阻尼振动 这个示例展示如何制作动画来演示指数包络如何把振动压下去。三条曲线共用同一个阻尼参数,标记点落在波形与包络相切的位置。 ![阻尼振动](https://eidograph-docs.metaphorprojects.link/images/examples/functions/damped-oscillation-envelope.png) [下载 damped-oscillation-envelope.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/damped-oscillation-envelope.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/damped-oscillation-envelope.eido) ### 两个正弦波的拍 这个示例展示如何制作动画来演示两个频率相近的波叠加产生的拍。两条正弦曲线、它们的和以及缓慢的包络一起画出,断言检查和差化积恒等式。 ![两个正弦波的拍](https://eidograph-docs.metaphorprojects.link/images/examples/functions/beats-from-two-sine-waves.png) [下载 beats-from-two-sine-waves.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/beats-from-two-sine-waves.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/beats-from-two-sine-waves.eido) ## 动起来的微积分 ### 从割线到切线 这个示例展示如何制作动画来演示割线趋于切线的极限过程。间隔趋向零,实时标签读出割线斜率,最后停在导数 4/3 上。 ![从割线到切线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/secant-to-tangent.png) [下载 secant-to-tangent.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/secant-to-tangent.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/secant-to-tangent.eido) ### 导函数的图像 这个示例展示如何制作动画来演示切线斜率如何描出导函数。locus 把每个 x 处的斜率记录成高度,描出来的绿色曲线就是 f′ 的图像。 ![导函数的图像](https://eidograph-docs.metaphorprojects.link/images/examples/functions/derivative-graph-from-slope.png) [下载 derivative-graph-from-slope.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/derivative-graph-from-slope.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/derivative-graph-from-slope.eido) ### 正弦的泰勒多项式 这个示例展示如何制作动画来演示五次泰勒多项式与正弦曲线贴合得有多紧。展开中心沿曲线移动,多项式逐帧围绕新的中心重新生成。 ![正弦的泰勒多项式](https://eidograph-docs.metaphorprojects.link/images/examples/functions/taylor-polynomial-of-sine.png) [下载 taylor-polynomial-of-sine.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/taylor-polynomial-of-sine.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/taylor-polynomial-of-sine.eido) ### 牛顿法 这个示例展示如何制作动画来演示牛顿法如何用切线追上方程的根。三次迭代都由初始猜测推导出来,断言检查第三次迭代已经落在根的 0.02 之内。 ![牛顿法](https://eidograph-docs.metaphorprojects.link/images/examples/functions/newtons-method-iteration.png) [下载 newtons-method-iteration.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/newtons-method-iteration.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/newtons-method-iteration.eido) ### 黎曼和的矩形 这个示例展示如何制作动画来演示取样点的位置如何改变黎曼和。十二个矩形的取样点从每段的左端滑到右端,标签实时读出当前的估计值。 ![黎曼和的矩形](https://eidograph-docs.metaphorprojects.link/images/examples/functions/riemann-sum-rectangles.png) [下载 riemann-sum-rectangles.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/riemann-sum-rectangles.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/riemann-sum-rectangles.eido) ## 方程曲线与圆锥曲线 ### 由方程画出的椭圆 这个示例展示如何制作动画来演示直接由 x²/a² + y²/b² = 1 画出的椭圆。隐式方程随 a、b 变化重新绘制,沿 (a·cos t, b·sin t) 移动的点由断言验证满足方程。 ![由方程画出的椭圆](https://eidograph-docs.metaphorprojects.link/images/examples/functions/ellipse-equation-and-axes.png) [下载 ellipse-equation-and-axes.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/ellipse-equation-and-axes.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/ellipse-equation-and-axes.eido) ### 双曲线与渐近线 这个示例展示如何制作动画来演示双曲线如何贴近渐近线却永不相交。顶点随 a 移动,两条虚线始终保持 ±b/a 的斜率,参数点一直留在右支上。 ![双曲线与渐近线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/hyperbola-and-asymptotes.png) [下载 hyperbola-and-asymptotes.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/hyperbola-and-asymptotes.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/hyperbola-and-asymptotes.eido) ### 超椭圆家族 这个示例展示如何制作动画来演示曲线族 |x/a|ⁿ + |y/b|ⁿ = 1。指数从 0.6 变到 6,曲线从内凹的星形经过椭圆变成圆角矩形。 ![超椭圆家族](https://eidograph-docs.metaphorprojects.link/images/examples/functions/superellipse-family.png) [下载 superellipse-family.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/superellipse-family.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/superellipse-family.eido) ### 笛卡儿叶形线 这个示例展示如何制作动画来演示笛卡儿叶形线以及它的分支所贴近的渐近线。参数点扫过整个环,隐式三次曲线随 a 的每个取值重新绘制。 ![笛卡儿叶形线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/folium-of-descartes.png) [下载 folium-of-descartes.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/folium-of-descartes.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/folium-of-descartes.eido) ### 卡西尼卵形线与双纽线 这个示例展示如何制作动画来演示到两个焦点距离之积为常数的曲线。常数变小时,单个卵形先收缩成伯努利双纽线,然后分裂成两个环。 ![卡西尼卵形线与双纽线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/cassini-ovals-and-lemniscate.png) [下载 cassini-ovals-and-lemniscate.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/cassini-ovals-and-lemniscate.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/cassini-ovals-and-lemniscate.eido) ## 参数曲线与极坐标曲线 ### 李萨如图形 这个示例展示如何制作动画来演示两个垂直方向的振动编织出的曲线。动点先沿曲线跑一圈,然后相位和频率比各自变化一次。 ![李萨如图形](https://eidograph-docs.metaphorprojects.link/images/examples/functions/lissajous-figures.png) [下载 lissajous-figures.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/lissajous-figures.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/lissajous-figures.eido) ### 极坐标玫瑰线 这个示例展示如何制作动画来演示 r = 3·cos(k·θ) 的花瓣数与 k 的关系。扫描臂实时读出当前的半径,k 从 2 增加到 8。 ![极坐标玫瑰线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/polar-rose.png) [下载 polar-rose.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/polar-rose.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/polar-rose.eido) ### 蚶线与心形线 这个示例展示如何制作动画来演示蚶线族以及藏在其中的心形线。一个形状参数把曲线从圆经过心形线的尖点变成带内环的曲线。 ![蚶线与心形线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/limacon-and-cardioid.png) [下载 limacon-and-cardioid.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/limacon-and-cardioid.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/limacon-and-cardioid.eido) ### 阿基米德螺线 这个示例展示如何制作动画来演示阿基米德螺线的圈与圈之间为什么等距。两条彩色线段量出 x 轴上相邻两圈的间距,断言检查它们始终相等。 ![阿基米德螺线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/archimedean-spiral.png) [下载 archimedean-spiral.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/archimedean-spiral.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/archimedean-spiral.eido) ### 万花尺外摆线 这个示例展示如何制作动画来演示一个圆绕另一个圆滚动时画笔画出的曲线。滚动圆始终与定圆相切,笔臂扫出一条四瓣外摆线。 ![万花尺外摆线](https://eidograph-docs.metaphorprojects.link/images/examples/functions/epitrochoid-spirograph.png) [下载 epitrochoid-spirograph.eido](https://eidograph-docs.metaphorprojects.link/downloads/functions/epitrochoid-spirograph.eido) · [在查看器中打开](https://eidograph-viewer.metaphorprojects.link/?src=https://eidograph-docs.metaphorprojects.link/downloads/functions/epitrochoid-spirograph.eido) --- URL: https://eidograph-docs.metaphorprojects.link/agents/integration # MCP、REST 与应用内 Agent Eidograph 提供三条 Agent 路径,但它们最终调用同一组工具: | 路径 | 适合场景 | 可用位置 | | --- | --- | --- | | 应用内 Agent | 直接用自然语言创建或修改当前项目 | Windows 与 Android 应用 | | MCP Streamable HTTP | 支持远程 HTTP MCP 的 Agent 平台 | Windows 应用 | | JSON REST API | 自动化脚本、工作流和自建 Agent | Windows 应用 | 工具修改脚本前会先编译候选内容。含编译错误或“命令被跳过”警告的修改会被拒绝,当前脚本保持不变;成功修改会立即保存、重绘并进入普通撤销历史。 ## 启用原生服务 1. 在已安装的应用中打开**设置 › MCP / REST 服务器**。 2. 开启服务器,确认状态显示运行中。默认端口是 `14159`。 3. 在工具列表中只启用客户端需要的权限。 4. 在**图形**面板检查每个图形旁的暴露圆点:实心表示外部客户端可访问。 5. 默认只监听本机;只有在可信网络中才开启 LAN 模式。 默认端点: ```txt MCP http://127.0.0.1:14159/mcp REST http://127.0.0.1:14159/api/v1 ``` **Danger** LAN 模式监听 `0.0.0.0`,也没有互联网中继。网络内的原生客户端可以调用你启用的工具,因此请先开启访问令牌再开启 LAN 模式,只在受信任网络使用,并在结束后关闭。 ## 启用访问令牌 服务器默认不做身份验证。只监听本机时这是安全的:只有本机已在运行的程序才能访问。在**设置 › MCP / REST 服务器 › 需要访问令牌**中开启后(开启 LAN 模式之前务必先开启),Eidograph 会生成一个密钥,每个请求都必须携带: ```txt Authorization: Bearer ``` 缺少该头的请求返回 `401`。设置中会显示令牌并提供复制按钮,**更换令牌**可轮换密钥,关闭开关则清除它。两者都立即生效,请同步更新所有已配置的客户端。 ## 让外部程序找到服务器 端口是一项设置,应用之外无法假定它的值。服务器运行期间 Eidograph 会写入一个发现文件,并在服务器停止或应用退出时删除它: | 平台 | 路径 | | --- | --- | | Windows | `%LOCALAPPDATA%\eidograph.metaphor.projects\server.json` | | macOS | `~/Library/Application Support/eidograph.metaphor.projects/server.json` | | Linux | `$XDG_DATA_HOME/eidograph.metaphor.projects/server.json` | ```json { "version": "0.2.19", "pid": 24680, "updatedAt": 1757000000000, "bindAddress": "127.0.0.1", "port": 14159, "mcp": "http://127.0.0.1:14159/mcp", "api": "http://127.0.0.1:14159/api/v1", "token": "3f9c…", "lanAddresses": [] } ``` 读取 `mcp` 或 `api`,并把 `token` 作为 bearer 令牌发送;不需要令牌时该字段为 `null`。即使在 LAN 模式下,文件中发布的 URL 也始终指向本机回环地址,因为读取这个文件的程序都在同一台机器上。**设置 › MCP / REST 服务器**会显示并复制确切路径。文件不存在就表示“服务器没有运行”,不要退回到猜测端口。 ## Claude Desktop Claude Desktop 把 MCP 服务器安装为本地 **stdio** 进程,因此不能直接填入 HTTP URL。安装 [eidograph-mcpb](https://github.com/metaphorprojects/eidograph-mcpb) 扩展即可桥接两者——它无需配置,会自行找到端口和访问令牌,并在每次请求时重新读取。详细的安装步骤、截图,以及如何指向运行在另一台设备上的 Eidograph,见 [Claude Desktop](https://eidograph-docs.metaphorprojects.link/agents/claude-desktop)。 ## 豆包桌面客户端 豆包桌面客户端支持通过 HTTP 自定义连接器填写 Eidograph 的 MCP 地址。带截图的操作步骤见[在豆包中连接 Eidograph](https://eidograph-docs.metaphorprojects.link/agents/doubao)。 ## 连接 MCP 平台 对于支持 **Streamable HTTP** 传输的客户端(例如应用内可直接复制配置所面向的 Trae / WorkBuddy),加入下面的服务器配置: ```json { "mcpServers": { "Eidograph": { "url": "http://127.0.0.1:14159/mcp", "transport": "streamable-http", "disabled": false } } } ``` 不同平台的配置文件位置和外层字段可能不同,但核心信息只有服务器名称、URL 和 Streamable HTTP 传输。若某个平台只支持本地 `stdio` MCP 进程,不能把 URL 直接填入 `command` 字段;需要该平台支持的 HTTP 连接器或桥接程序。 连接后先让客户端执行工具发现,再读取当前脚本或命令注册表。推荐的 Agent 顺序是: 1. `list_figures` 确认目标图形; 2. `get_script` 与 `list_objects` 理解现状; 3. `list_commands` 查询当前 2D/3D 方言的有效语法; 4. 优先用 `append_commands` 增量修改;只有重写已有行时才用 `set_script`; 5. 调用 `list_diagnostics` 检查结果,必要时修正后重试。 ## 调用 REST API 端点契约、全部工具 Schema、导出编码、错误行为以及 JavaScript/Python/PowerShell 示例详见 [REST API 参考](https://eidograph-docs.metaphorprojects.link/agents/rest-api)。 先检查状态与工具: ```bash curl http://127.0.0.1:14159/api/v1/status curl http://127.0.0.1:14159/api/v1/tools ``` 创建两个点和一条线段: ```bash curl -X POST http://127.0.0.1:14159/api/v1/tools/append_commands \ -H "Content-Type: application/json" \ -H "X-Eidograph-Client: my-agent" \ -d '{"commands":"point A -2 0\npoint B 2 0\nsegment s A B"}' ``` 响应使用统一结构:成功为 `{"ok":true,"result":...}`,失败为 `{"ok":false,"error":...}`。`X-Eidograph-Client` 是可选的,会让设置中的活动记录显示易读的调用方名称。 当前工具包括读取与列出图形、创建图形、追加/替换脚本、列出对象/诊断/命令、在画布上选中对象,以及把暴露图形导出为 SVG、PNG、GIF 或 MP4。服务器的工具开关与图形暴露开关会在每次调用时生效。 ## 配置应用内 Agent 在**设置 › Agent**中可以保存多个模型,并在 Agent 面板头部切换。支持三类协议: - OpenAI 兼容的 Chat Completions 端点; - Anthropic Messages; - Google Gemini / Vertex `generateContent`。 每个模型填写显示名称、提供商、Base URL、API 密钥和模型 ID。模型列表获取失败时仍可手动输入 ID。Ollama、LM Studio 等本地端点也可以使用,但端点需要允许应用 WebView 发起跨域请求(CORS)。 应用内 Agent 可附加或粘贴图片,适合把课本照片或草图转成构造。模型是否支持视觉输入由端点决定;不支持时错误会显示在对话中。 在 Windows 和 Android 应用中,Agent 还可以上网查资料:**web_search** 通过 DuckDuckGo 搜索定理、作图方法或参考图,**web_fetch** 按 URL 读取网页文本或查看图片(例如需要复现的示意图)。只能访问公共网站。这两个工具仅供应用内 Agent 使用,不属于 MCP/REST 工具面。 ## 权限与数据边界 - 应用内 Agent 和外部客户端没有隐藏的特权路径,均受同一工具定义约束。 - 外部修改只作用于活动项目,并遵守每个图形的暴露状态。 - API 密钥不会写入 `.eido`。Windows 和 Android 应用使用系统保护的凭据存储。 - Agent 聊天默认不进入 `.eido`,需要共享时必须显式开启“包含 Agent 聊天”。 --- URL: https://eidograph-docs.metaphorprojects.link/agents/rest-api # REST API 参考 Eidograph REST API 让本机脚本或自建 Agent 读取和修改 Windows 应用中当前打开的项目。它与 MCP 服务器使用同一组工具、编译校验、撤销历史、图形权限和使用额度。 API 由已安装的 Windows 应用提供。客户端工作期间必须保持 Eidograph 运行;Eidograph 不提供托管 REST 服务或面向用户的 Web 版。 ## 快速开始 1. 在 Eidograph 中打开**设置 › MCP / REST 服务器**。 2. 开启服务器,并只启用客户端需要的工具。 3. 在**图形**面板把目标图形的暴露圆点设为实心。 4. 确认状态为运行中。默认 Base URL 是: ```txt http://127.0.0.1:14159/api/v1 ``` 先发现工具,再向当前图形追加一个构造: ```bash curl http://127.0.0.1:14159/api/v1/tools curl -X POST http://127.0.0.1:14159/api/v1/tools/append_commands \ -H "Content-Type: application/json" \ -H "X-Eidograph-Client: geometry-script" \ -d '{"commands":"point A -2 0\npoint B 2 0\nsegment s A B"}' ``` 成功响应: ```json { "ok": true, "result": "ok — no diagnostics" } ``` ## 传输与安全 ### Base URL 与 JSON 下文路径均相对于 `http://127.0.0.1:14159/api/v1`。若在设置中更改端口,客户端也必须更新 URL —— 也可以从服务器运行期间应用写入的发现文件中读取当前地址,详见 [MCP、REST 与应用内 Agent](https://eidograph-docs.metaphorprojects.link/agents/integration)。工具调用使用 `POST`、JSON 对象以及 `Content-Type: application/json`。 当前 REST 接口只有 `/api/v1`,没有额外的版本协商。 ### 身份验证与网络范围 服务器没有 TLS;除非你自行设置,也没有密码。默认回环模式只允许同一台电脑上的客户端访问。开启**允许同一网络客户端**后,服务器监听 `0.0.0.0`;任何能访问该端口的设备都可以调用已启用工具,并操作已暴露图形。 在同一设置面板中开启**需要访问令牌**(开启 LAN 模式之前务必先开启),之后每个请求都必须携带生成的密钥: ```http Authorization: Bearer ``` 缺少该头的请求会返回 `401` 和 `{"ok":false,"error":"missing or invalid bearer token"}`。这同样适用于 `/status` 与 `/activity`。令牌会写入发现文件,因此本机客户端可以直接读取,而无需手动配置。 **Danger** LAN 模式只能用于可信网络。不要转发端口、通过隧道发布或暴露到互联网。 可选请求头: ```http X-Eidograph-Client: my-automation ``` 它只是在外部活动记录中显示的调用方名称,**不是身份验证**。未提供时会记录调用方 IP。 ### Origin 检查 命令行工具、Node.js、Python、PowerShell 和原生 Agent 通常不发送 `Origin`,这类请求可以通过。如果请求带有 `Origin`,其主机必须是 `localhost`、`127.0.0.1` 或 `::1`,否则工具发现和工具调用返回 `403`。 REST API 面向原生与命令行客户端,而不是任意网页。即使 Origin 主机在本机,浏览器的 CORS 和预检也可能阻止请求。 ### 权限与副作用 每次执行工具时都会重新检查权限: - **设置 › MCP / REST 服务器 › 工具**是工具允许列表; - **图形**面板的实心暴露圆点决定外部客户端能否看到该图形; - “当前图形”工具总是操作 UI 中活动的项目和图形; - `create_figure` 会创建并激活图形,`select_object` 会改变画布选中项; - 脚本编辑在提交前编译。出现错误或“命令被跳过”警告时,整个编辑被拒绝,原脚本不变; - 成功编辑会立即重绘、保存到工作区并进入普通撤销历史。 不要并发发送依赖同一脚本版本的编辑。请串行调用,并在整体重写前重新执行 `get_script`。 ## 请求体与响应 推荐直接把参数对象作为请求体: ```http POST /api/v1/tools/get_figure_script Content-Type: application/json X-Eidograph-Client: docs-example {"name":"图形 2"} ``` 也支持 RPC 风格的 `arguments` 包装: ```json { "arguments": { "name": "图形 2" } } ``` 无参数工具可以传 `{}` 或空请求体。 工具成功: ```json { "ok": true, "result": "工具特定的返回值" } ``` 工具失败: ```json { "ok": false, "error": "tool `set_script` is disabled" } ``` 多数读取工具返回文本。`list_figures`、`list_objects` 与 `list_commands` 的 `result` 是一个**包含 JSON 的字符串**;需要结构化数据时要再解析一次。`export_figure` 例外,它直接返回 JSON 对象。 | HTTP 状态 | 含义 | | --- | --- | | `200 OK` | 状态/活动读取、成功发现或成功执行工具 | | `400 Bad Request` | 参数、工具、图形、编译或额度错误 | | `403 Forbidden` | 工具发现或调用带有不可信 `Origin` | | `503 Service Unavailable` | 工具发现无法连接 Eidograph UI 桥 | | `404 Not Found` | 路径不存在 | | `405 Method Not Allowed` | 已知路径使用了错误 HTTP 方法 | 无效 JSON 或错误 Content-Type 可能产生框架错误,而不是标准 `{ "ok": false }` 结构。客户端应同时检查 HTTP 状态以及存在时的 `ok` 字段。 ## 端点 ### `GET /status` 直接返回原生服务器状态,不使用 `ok` 包装: ```bash curl http://127.0.0.1:14159/api/v1/status ``` ```json { "running": true, "bridgeReady": true, "bindAddress": "127.0.0.1", "port": 14159, "lanAddresses": [], "lastError": null } ``` | 字段 | 类型 | 说明 | | --- | --- | --- | | `running` | boolean | HTTP 监听器是否运行。 | | `bridgeReady` | boolean | 应用 UI 是否可以执行工具。 | | `bindAddress` | string 或 null | 通常为 `127.0.0.1` 或 `0.0.0.0`。 | | `port` | integer 或 null | 实际监听端口。 | | `lanAddresses` | 字符串数组 | 同一网络的客户端可访问的全部基础地址,按优先级排序(私有网段在前),最多 10 个。未开启 LAN 模式时为空。 | | `lastError` | string 或 null | 最近的监听器错误。 | `running: true`、`bridgeReady: false` 表示端口已打开,但工具暂时不能执行;应等待两者都为 `true`。 ### `GET /activity` 返回最近最多 200 次 MCP/REST 工具调用,新记录在前。状态、活动读取和工具发现不会记录。 ```json { "activity": [ { "id": "342daa36-e4d3-4c96-aebe-d358d60a96dd", "at": 1788112800123, "transport": "rest", "caller": "geometry-script", "tool": "append_commands", "ok": true, "durationMs": 18 } ] } ``` `at` 是 Unix 毫秒时间戳,`durationMs` 是整个桥接与工具调用的耗时。客户端可以自行填写 `caller`,不能把它当作已验证身份。 ### `GET /tools` 只返回设置中当前启用的工具,不消耗工具调用额度: ```bash curl http://127.0.0.1:14159/api/v1/tools ``` 缩略响应: ```json { "ok": true, "tools": [ { "name": "append_commands", "description": "Append one or more command lines...", "inputSchema": { "type": "object", "properties": { "commands": { "type": "string" } }, "required": ["commands"] } } ] } ``` 此端点是运行时权威来源:说明和 JSON Schema 直接来自应用与 MCP 服务器共用的工具定义。 ### `POST /tools/{tool}` 执行一个已启用工具。把 `{tool}` 换为发现到的工具名称,并把参数放入 JSON 请求体: ```bash curl -X POST http://127.0.0.1:14159/api/v1/tools/list_objects \ -H "Content-Type: application/json" \ -d '{}' ``` 每次真正执行工具都会消耗一次外部 API 额度,包括进入工具后失败的调用;状态、活动和发现免费。导出成功生成字节后还会消耗导出额度。Pro 版不受这些限制;当前免费额度以应用的**设置 › 账户**为准。 ## 工具参考 `GET /tools` 返回的 Schema 是权威定义。下表列出当前完整接口;禁用的工具不会出现在发现结果中,直接调用也会失败。 | 工具 | 请求体 | `result` 与行为 | | --- | --- | --- | | `get_script` | `{}` | 当前已暴露图形的完整 Eidolang 源码字符串。 | | `list_figures` | `{}` | JSON 字符串:已暴露图形的 `{ name, kind, active }[]`;未暴露图形被省略。 | | `get_figure_script` | `{ "name": string }` | 按精确显示名称读取已暴露图形,不切换活动图形。 | | `create_figure` | `{ "kind": "plane" | "solid", "name"?: string }` | 创建并激活图形;返回确认文本。`kind` 创建后固定。 | | `append_commands` | `{ "commands": string }` | 追加换行分隔的命令;返回诊断摘要,只在候选脚本有效时提交。 | | `set_script` | `{ "source": string }` | 替换全部源码;返回诊断摘要,只在候选脚本有效时提交。 | | `list_objects` | `{}` | JSON 字符串:编译对象的 `{ name, kind, tier, status, info }[]`。 | | `list_diagnostics` | `{}` | 可读诊断文本;没有问题时为 `ok — no diagnostics`。 | | `list_commands` | `{}` | JSON 字符串:当前 `plane`/`solid` 方言的 `{ kind, signature }[]`。 | | `select_object` | `{ "name": string }` | 在当前画布选中并高亮对象;返回确认文本。 | | `export_figure` | 见下文 | 直接返回包含文件内容的对象。 | ### 编辑工具的事务语义 `append_commands` 适合增量添加,`set_script` 只应在必须修改或删除已有行时使用。两者都会先编译候选脚本。如果存在错误或 skipped-command 警告,HTTP 与 `ok` 仍可能表示工具本身执行成功,但 `result` 会说明编辑没有应用: ```json { "ok": true, "result": "error line 2: unknown command `circel`\n hint: ...\nedit not applied — the current script is unchanged. Fix the first reported issue; later errors may be consequences, then retry." } ``` 因此调用方必须检查诊断文本,不能只检查 `ok`。整体替换前应先调用 `get_script`,防止覆盖更新后的内容。 ### 列表结果示例 把 `list_figures` 的 `result` 再解析一次后: ```json [ { "name": "构造", "kind": "plane", "active": true }, { "name": "立体模型", "kind": "solid", "active": false } ] ``` 把 `list_objects` 的 `result` 再解析一次后: ```json [ { "name": "A", "kind": "point", "tier": "free", "status": "ok", "info": "(-2, 0)" }, { "name": "s", "kind": "segment", "tier": "derived", "status": "ok", "info": "len 4" } ] ``` `info` 是简短值摘要;无效对象的 `info` 是失败原因。`tier` 通常为 `free`、`bound`、`derived` 或 `null`。 `list_commands` 的每项包含命令 `kind` 与实时 `signature`。命令可能随应用演进,生成式客户端不应硬编码整个命令表。 ### `export_figure` 使用图形的实时渲染器导出已暴露图形。指定非活动图形时,Eidograph 会临时挂载该图形,完成后恢复原来的活动图形。 ```json { "figure": "构造", "format": "png", "region": "content", "scale": 2, "transparent": true, "grid": false } ``` | 参数 | 类型 | 必需 | 说明 | | --- | --- | --- | --- | | `figure` | string | 否 | 已暴露图形的精确名称;默认当前图形。 | | `format` | `svg`、`png`、`gif` 或 `mp4` | 是 | 输出格式。 | | `region` | `view` 或 `content` | 否 | 当前视图或适应内容;默认 `content`。 | | `crop` | object | 否 | 仅平面图形:屏幕坐标 `{ x, y, width, height }`;覆盖 `region`,宽高必须为正。 | | `scale` | `1`、`2` 或 `4` | 否 | `png`、`gif`、`mp4` 的像素倍率;默认使用应用导出偏好。 | | `transparent` | boolean | 否 | 仅平面静态图;默认使用应用导出偏好。 | | `grid` | boolean | 否 | 是否包含坐标网格;默认使用应用导出偏好。 | | `fps` | 1–60 的整数 | 否 | `gif`、`mp4` 的帧率;默认使用应用导出偏好。 | | `seconds` | 0.1–3600 的数字 | 否 | `gif`、`mp4` 的时长;默认为时间轴的一个循环。 | | `mode` | `timeline` 或 `orbit` | 否 | `gif`、`mp4` 的运动来源;默认 `timeline`。 | 立体图形不接受 `transparent: true`,自定义裁剪仅支持平面图形。 ### 动画导出 `gif` 与 `mp4` 会逐帧渲染图形的 `animate` / `stage` 时间轴。`mode: "orbit"` 改为让相机绕立体图形旋转,因此静态模型也能导出,但平面图形不接受该模式。两种格式都不支持透明背景。单次渲染上限为 1800 帧,时长与帧率过高的请求会被截断。 这类调用比静态导出慢得多,可能需要数秒到数分钟,因此 `export_figure` 的桥接预算是 600 秒,而其他工具都是 30 秒。MP4 还需要应用 WebView 支持 H.264 WebCodecs。 ```json { "format": "mp4", "mode": "orbit", "seconds": 6, "fps": 30, "scale": 2 } ``` PNG 结果: ```json { "figure": "构造", "fileName": "构造.png", "format": "png", "mimeType": "image/png", "encoding": "base64", "data": "iVBORw0KGgoAAA..." } ``` SVG 返回 `mimeType: "image/svg+xml"`、`encoding: "utf8"`,`data` 是 SVG 文本。PNG、GIF、MP4 的 `data` 是不带 `data:` 前缀的 Base64,`mimeType` 分别为 `image/png`、`image/gif`、`video/mp4`。 动画结果额外包含 `animation` 对象,说明实际渲染的内容,便于判断是否触发了帧数上限: ```json { "animation": { "mode": "orbit", "seconds": 6, "frames": 180, "fps": 30, "capped": false } } ``` 在 MCP 上,PNG 与 GIF 以原生 `image` 内容返回,MP4 则以嵌入式二进制 `resource` 返回,因为 MCP 没有视频内容类型。 ### `save_project` 将当前活动项目保存为 `.eido` 包,直接写入指定路径 —— 不会弹出原生保存对话框,因为这类调用没有用户在场点击它。 ```json { "path": "C:\\Users\\me\\Documents\\构造.eido" } ``` | 参数 | 类型 | 必需 | 说明 | | --- | --- | --- | --- | | `path` | string | 视情况而定 | 保存目标的绝对路径。项目首次保存时必填;之后省略则覆盖项目已知的文件。缺少 `.eido` 后缀会自动补上。 | **结果:** 项目实际保存到的绝对路径。 ### `open_project` 按绝对路径打开一个 `.eido` 包(或裸 `.geo`/`.txt` 脚本)为新的项目标签页 —— 相当于应用“打开”对话框的无界面版本。 ```json { "path": "C:\\Users\\me\\Documents\\构造.eido" } ``` | 参数 | 类型 | 必需 | 说明 | | --- | --- | --- | --- | | `path` | string | 是 | 要打开文件的绝对路径。 | **结果:** 项目打开并成为活动项目后的确认字符串。 ## 完整客户端示例 ### JavaScript(Node.js 20+) 以下是服务端 Node.js 代码,不是浏览器代码: ```js const baseUrl = 'http://127.0.0.1:14159/api/v1' async function callTool(name, arguments_ = {}) { const response = await fetch(`${baseUrl}/tools/${encodeURIComponent(name)}`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Eidograph-Client': 'node-example', }, body: JSON.stringify(arguments_), }) const body = await response.json() if (!response.ok || !body.ok) { throw new Error(body.error || `HTTP ${response.status}`) } return body.result } const figures = JSON.parse(await callTool('list_figures')) console.log(figures) console.log(await callTool('append_commands', { commands: 'point A -2 0\npoint B 2 0\nsegment s A B', })) ``` ### Python 3:导出 PNG 仅使用 Python 标准库: ```python import base64 import json from pathlib import Path from urllib.error import HTTPError from urllib.request import Request, urlopen BASE_URL = "http://127.0.0.1:14159/api/v1" def call_tool(name, arguments=None): request = Request( f"{BASE_URL}/tools/{name}", data=json.dumps(arguments or {}).encode("utf-8"), method="POST", headers={ "Content-Type": "application/json", "X-Eidograph-Client": "python-example", }, ) try: with urlopen(request) as response: body = json.load(response) except HTTPError as error: body = json.load(error) raise RuntimeError(body.get("error", f"HTTP {error.code}")) from error if not body.get("ok"): raise RuntimeError(body.get("error", "unknown Eidograph error")) return body["result"] export = call_tool("export_figure", { "format": "png", "region": "content", "scale": 2, "grid": False, }) Path(export["fileName"]).write_bytes(base64.b64decode(export["data"])) print(f"saved {export['fileName']}") ``` SVG 应把 `export["data"]` 作为 UTF-8 文本写入,不要 Base64 解码。 ### PowerShell 7+ ```powershell $baseUrl = 'http://127.0.0.1:14159/api/v1' $headers = @{ 'X-Eidograph-Client' = 'powershell-example' } $commands = @' point O 0 0 circle c O radius 3 point P on c at 45deg segment radius O P '@ $body = @{ commands = $commands } | ConvertTo-Json $response = Invoke-RestMethod ` -Method Post ` -Uri "$baseUrl/tools/append_commands" ` -Headers $headers ` -ContentType 'application/json' ` -Body $body if (-not $response.ok) { throw $response.error } $response.result ``` ### 创建图形并设置完整脚本 ```bash export EIDO_API='http://127.0.0.1:14159/api/v1' curl -sS -X POST "$EIDO_API/tools/create_figure" \ -H 'Content-Type: application/json' \ -H 'X-Eidograph-Client: curl-workflow' \ -d '{"kind":"plane","name":"Circle API demo"}' curl -sS -X POST "$EIDO_API/tools/set_script" \ -H 'Content-Type: application/json' \ -H 'X-Eidograph-Client: curl-workflow' \ -d '{"source":"space plane\npoint O 0 0\ncircle c O radius 3\npoint P on c at 45deg\nsegment radius O P\n"}' curl -sS -X POST "$EIDO_API/tools/list_diagnostics" \ -H 'Content-Type: application/json' \ -d '{}' ``` ## 故障排查 | 现象 | 检查内容 | | --- | --- | | Connection refused | 开启服务器、确认端口、保持 Eidograph 运行并检查 `/status`。 | | `bridgeReady` 为 false | 等待项目 UI 加载完成,或重启应用。 | | `tool ... is disabled` | 在服务器设置中启用该工具,然后重新发现。 | | `no figure is open` | 调用 `create_figure`,或在应用中打开并暴露图形。 | | `the current figure is not exposed` | 在**图形**面板把目标圆点设为实心。 | | 成功响应中出现 “edit not applied” | 修复第一条编译诊断后重试;原脚本没有改变。 | | `403 untrusted Origin` | 使用原生/命令行客户端或移除非本地 Origin;不要削弱 LAN 安全。 | | 不能切换图形导出 | 结束锁定图形切换的操作,手动激活目标,或导出当前图形。 | | 每日额度错误 | 查看**设置 › 账户**,等待每日重置或解锁 Pro。 | | 请求在 30 秒后超时 | 检查 `/status`、恢复应用状态、避免并行长调用后重试。 | 需要使用 Streamable HTTP 的 Agent 工具发现与资源读取时,请参阅 [MCP、REST 与应用内 Agent](https://eidograph-docs.metaphorprojects.link/agents/integration)。 --- URL: https://eidograph-docs.metaphorprojects.link/agents/claude-desktop # Claude Desktop Claude Desktop 把 MCP 服务器安装为本地 **stdio** 进程,因此无法直接填入 Eidograph 的 Streamable HTTP 端点。[eidograph-mcpb](https://github.com/metaphorprojects/eidograph-mcpb) 是一个小型 `.mcpb` 扩展,用于桥接两者:它与 Claude Desktop 之间使用 stdio 通信,并把每个请求转发到 Eidograph[发现文件](https://eidograph-docs.metaphorprojects.link/agents/integration#find-the-server-from-another-program)中发布的端点。所有流量都留在本机——除非你自己把它指向另一台设备(见下文),否则不会离开回环地址。 ## 安装扩展 1. 从 GitHub 上的 [eidograph-mcpb 仓库](https://github.com/metaphorprojects/eidograph-mcpb)下载最新的 `eidograph.mcpb`。 2. 打开下载的文件,或把它拖到 Claude Desktop 的**设置 › 扩展**页面。Claude Desktop 会显示该扩展的详情和一个**安装**按钮: ![Claude Desktop 显示 Eidograph 扩展的安装页面](https://eidograph-docs.metaphorprojects.link/images/agents/claude-desktop/extension-install.png) **Warning** Claude Desktop 会提示扩展可以访问电脑上的一切——这是所有扩展通用的警告文案。eidograph-mcpb 实际只在 Claude Desktop 和 Eidograph 的本机 HTTP 端点之间转发 JSON-RPC,不会触及文件系统或网络中的其他内容。 3. 点击**安装**。之后 Eidograph 会出现在**设置 › 扩展**中,与你安装的其他扩展并列: ![Claude Desktop 的扩展设置中列出已安装的 Eidograph 扩展](https://eidograph-docs.metaphorprojects.link/images/agents/claude-desktop/extensions-settings.png) 无需其他设置。这个扩展会在每次请求时重新读取 Eidograph 的发现文件,因此启动应用、开启其服务器或更改端口都会立即生效,无需重新安装或重启。如果 Eidograph 已关闭或其服务器未开启,工具调用会失败并给出需要开启哪项设置的错误提示。 ## 配置自定义服务器地址 在扩展列表中点击 Eidograph 旁的**配置**打开其设置: ![Eidograph 扩展的配置页面,包含端点、令牌与发现文件覆盖项](https://eidograph-docs.metaphorprojects.link/images/agents/claude-desktop/extension-configure.png) 这三项都是可选的,仅在发现文件无法覆盖的场景中才需要: | 设置 | 作用 | | --- | --- | | 端点覆盖 | 改为拨号到这个地址,而不是 Eidograph 发布的地址。接受 `http://host:port` 或完整的 `.../mcp` URL。 | | 访问令牌覆盖 | 改为发送这个令牌,而不是 Eidograph 发布的令牌。 | | 发现文件覆盖 | 从这个路径读取握手信息,而不是标准的系统位置。 | 当 Eidograph 运行在与 Claude Desktop **不同的设备**上时——例如手机或平板上的 Android 应用,而 Claude Desktop 运行在你的电脑上——就需要用到这些设置: 1. 在运行 Eidograph 的设备上打开**设置 › MCP / REST 服务器**,先开启**需要访问令牌**,再开启 **LAN 模式**——顺序很重要,因为 LAN 模式会接受网络中其他设备的连接。 2. 记下页面显示的局域网地址和端口(例如 `http://192.168.1.23:14159`),并复制访问令牌。 3. 回到 Claude Desktop 中 Eidograph 的配置页面,把**端点覆盖**设为该地址,把**访问令牌覆盖**设为刚才复制的令牌,然后点击**保存**。 **Danger** LAN 模式没有互联网中继,但一旦网络中的设备知道地址,就能调用你启用的工具。请保持访问令牌开启,只在受信任的网络中使用 LAN 模式,用完后关闭它。 ## 卸载或更新 在扩展列表中关闭开关或点击**卸载**。要更新时,按同样的方式安装新版的 `eidograph.mcpb`,Claude Desktop 会原地替换旧版本。 --- URL: https://eidograph-docs.metaphorprojects.link/agents/doubao # 在豆包中连接 Eidograph 豆包桌面客户端可以通过自定义连接器访问 Eidograph 的 MCP 工具。两款应用需要运行在**同一台电脑**上;豆包的自定义连接器页面也注明它仅在本地电脑中使用。 ## 启动 Eidograph 的 MCP 服务 1. 在 Eidograph 中打开**设置 › MCP / REST 服务器**,开启服务器。 2. 确认服务器显示为运行中,记下页面显示的 MCP 地址。默认地址是 `http://127.0.0.1:14159/mcp`;如果修改过端口,以设置页面显示的地址为准。 3. 按需要启用工具,并确认要操作的图形已允许外部客户端访问。若开启了**需要访问令牌**,还要复制设置页面中的令牌。 ## 在豆包中添加自定义连接器 1. 打开豆包桌面客户端,进入左侧的**技能·连接器·伙伴**。 2. 点击右上角的 **+**,在菜单中选择**新建自定义连接器**。 ![豆包的技能页面中,右上角菜单展开并选中“新建自定义连接器”](https://eidograph-docs.metaphorprojects.link/images/agents/doubao/new-connector-menu.png) 3. 在弹出的表单中,将**服务器名称**填为 `Eidograph`,**传输类型**选为 `HTTP`,**服务器 URL** 填入 Eidograph 设置页面显示的 MCP 地址。 4. 如果 Eidograph 已开启访问令牌,在**自定义 Headers** 中添加 `Authorization`,值填为 `Bearer <令牌>`,把 `<令牌>` 替换为复制的实际令牌。没有开启访问令牌时,无需添加这个 Header。 5. 点击**保存**。 ![豆包的新建自定义连接器表单,填写 Eidograph、HTTP 和本机 MCP 地址](https://eidograph-docs.metaphorprojects.link/images/agents/doubao/connector-settings.png) 保存后,可以在豆包对话中尝试使用 Eidograph 工具。若连接失败,先检查 Eidograph 的服务器是否仍在运行、端口是否与表单中的 URL 一致;收到 `401` 时检查访问令牌及 `Bearer ` 前缀。Eidograph 的工具权限与图形暴露设置也会影响豆包能看到和操作的内容。更多设置见 [MCP、REST 与应用内 Agent](https://eidograph-docs.metaphorprojects.link/agents/integration)。 --- URL: https://eidograph-docs.metaphorprojects.link/faq # 常见问题 ## 为什么有些点不能拖动? 橙色自由点可以直接拖动,紫色绑定点只能沿路径拖动,灰色派生点由表达式计算,不能直接改变。要移动派生点,请拖动它依赖的自由或绑定对象。 ## 画布操作会不会和脚本冲突? 不会。工具操作、拖动、属性修改和参数滑块最终都修改同一份 Eidolang 文本。文本是唯一事实来源,画布只是它的实时计算结果。 ## `.eido` 和 `.txt` 有什么区别? `.eido` 是一个完整项目,包含多个图形、清单和项目设置;`.txt`/`.geo` 只是一个图形的裸 Eidolang 脚本。打开 `.eido` 会新增项目标签,拖入 `.txt` 或 `.geo` 会在当前项目中新增图形。 ## 为什么重新打开后视角或缩放不同? 摄像机角度、平移缩放、网格样式和选择属于本机视图状态,不进入 `.eido`。项目自己的缩放上下限与自动吸附设置会保存。 ## 2D 和 3D 图形能互相转换吗? 不能直接转换。图形在创建时固定为 `plane` 或 `solid`,并使用各自的 Eidolang 方言。需要另一种空间时,请新建对应图形并改写构造。 ## MCP 已连接但看不到图形怎么办? 检查应用当前是否为目标项目、图形面板旁的暴露圆点是否为实心、对应读取工具是否启用。外部调用只访问当前项目中已暴露的图形。 ## 导出图片为什么没有坐标网格? 导出对话框有独立的**坐标网格**开关,设置中的导出默认值只决定它的初始状态。每次导出都可以覆盖默认值。 ## Agent 聊天会随项目发给别人吗? 默认不会。只有开启**设置 › 常规 › 包含 Agent 聊天**后,保存的 `.eido` 才会包含该项目的会话。API 密钥始终不会写入项目文件。