Skip to content

Consistent Image Export Across Workflows ​

A geometry project may start with AI generation, continue through manual editing, and eventually be exported through the SDK, MCP, or Dino-GSP APIs. Save the composition parameters in the project so that each step can reuse the same bounds, viewing direction, and image dimensions.

Use a finite canvas for planar geometry (2D), and a fixed view for solid geometry (3D). Configure this whether the project is generated through MCP or edited manually. Projects generated through the Dino-GSP AI figure generation API automatically include an AI-recommended finite canvas or fixed view. Review the subject, annotations, and margins before reusing it.

Feature comparison: a 2D finite canvas defines coordinate bounds and layout scale; a 3D fixed view defines the camera and crop, saved for reuse in later editing and exports

Set the bounds during generation and editing ​

Project sourceRecommended action
Manual editing, including an embedded SDK canvasAfter adjusting the composition, set a finite canvas for 2D or save and enable a fixed view for 3D. Then save the project so later exports can reuse the composition.
Dino-GSP AI figure generation APIKeep the AI-recommended finite canvas or fixed view, review and adjust it as needed, and save it with the complete project.
Generation with a custom agentAfter drawing, ask the AI to recommend crop parameters based on the geometry, text, and annotations. For 2D, provide bounds and a layout scale, then set a finite canvas. For 3D, provide viewing angles, zoom, full viewport dimensions, and a crop rectangle, then configure and enable a fixed view. Keep the subject and annotations fully visible, geometric relationships clear, and margins balanced. Check and adjust an export preview, then report the final parameters.

Preview the project before handoff. Check that the subject and annotations are fully visible, margins are suitable, and the 3D view clearly shows geometric relationships.

Reuse these parameters during later editing. If the composition needs to change, update the finite canvas or fixed view and save the project for subsequent steps.

2D and 3D fields have different meanings ​

ItemPlanar geometry (2D): finite canvasSolid geometry (3D): fixed view
Project fieldsslides[].viewBoundsslides[].viewCamera3d, with viewCamera3dEnabled: true
What defines the viewWorld-coordinate bounds: minX, maxX, minY, maxYCamera center, viewing angles, projection, zoom, full viewport dimensions, and an optional crop rectangle
scaleLogical pixels per world-coordinate unit; changing it with unchanged bounds changes the logical output dimensionsCamera zoom; increasing it zooms in and reduces the visible world range, changing composition. The 2D size formula does not apply.
Rectangle coordinatesExport left/right/bottom/top are world coordinates, with Y pointing up and bottom < topcrop.left/top/right/bottom are logical pixel coordinates within the full viewport, with the origin at the top left, Y pointing down, and top < bottom
Image dimensionsCalculated from world-coordinate bounds, scale, and pixelRatioCalculated from full logical viewport width/height or the enabled crop rectangle, and pixelRatio

pixelRatio controls the physical pixel dimensions of the export. With the same composition, use the same multiplier to keep pixel dimensions consistent.

To increase resolution alone, adjust pixelRatio and keep the view parameters unchanged.

Planar geometry: set a finite canvas ​

A finite canvas defines the output bounds in world coordinates and the layout scale. There are three ways to configure it.

Call REPL through the SDK ​

In SDK edit mode, use editor.repl() to set bounds for the current 2D canvas:

ts
await editor.repl('view_bounds (-6, 6, -4, 4, 50)');

The arguments are minX, maxX, minY, maxY, and scale.

  • view_bounds: query the current settings.
  • view_bounds infinite: restore an infinite canvas.

Ask the AI to make changes through MCP ​

Give an AI connected through MCP a request such as:

Set a finite canvas for the current 2D canvas. Recommend bounds and a layout scale that best present the subject and annotations. Check an export preview to ensure all content is visible with suitable margins, and report the final parameters.

The AI runs view_bounds through MCP's repl tool to save the bounds to the canvas.

Adjust it in the embedded canvas ​

In the embedded canvas editor, configure the finite canvas bounds and layout scale. Check the preview, then save the complete project.

Setting a finite canvas in the canvas UI

Solid geometry: configure and enable a fixed view ​

A 3D fixed view saves the viewing direction, projection, camera center, viewport dimensions, and crop bounds. The same three configuration methods are available.

Call REPL through the SDK ​

In SDK edit mode, use editor.repl() to configure and enable a fixed view for the current 3D canvas:

ts
await editor.repl(`view_camera3d {
  offset: (0, 0, 0);
  projection: "orthographic";
  yawDeg: 45;
  pitchDeg: 30;
  scale: 0.1;
  width: 1200;
  height: 800;
  crop: (100, 50, 1100, 750);
}`);

This command sets the parameters and enables the fixed view.

  • view_camera3d: query only; does not enable the view.
  • view_camera3d off: disable the view while retaining its parameters.
  • view_camera3d on: enable the view again.

Ask the AI to make changes through MCP ​

Give an AI connected through MCP a request such as:

Configure and enable a fixed view for the current 3D canvas. Recommend viewing angles, zoom, viewport dimensions, and crop bounds that clearly show the geometric relationships. Check an export preview to ensure the subject and annotations are fully visible with suitable margins, and report the final parameters.

The AI runs view_camera3d through MCP's repl tool to save and enable the configuration.

Adjust it in the embedded canvas ​

In the embedded canvas editor, configure the fixed view's viewing angles, zoom, viewport dimensions, and crop bounds.

Check the preview, then enable the fixed view and save the complete project.

Setting a 3D fixed view in the embedded canvas

Reuse the configuration downstream ​

Set a finite canvas or fixed view during initial generation and save the complete project. Later steps can reuse it without repeatedly adjusting the composition.

MCP ​

Ask the AI to export using the bounds and viewing direction saved in the project. Use export_image for 2D or export_image_3d for 3D, without specifying view parameters again.

See the MCP documentation for setup and usage.

Dino-GSP PNG API ​

Call POST /api/render/v2 with the complete project as content and the target canvas as slideIndex. Omit view2D / view3D to reuse the saved configuration.

See the PNG export API for request examples and optional parameters.

Embedded SDK canvas ​

Read the saved configuration and pass it to exportImage with mode: 'view':

  • 2D: read it with getViewBounds() and pass the result as viewBound.
  • 3D: read it with getViewCamera3d() and pass the result as viewCamera3d.

See SDK image export for complete examples.

When the composition needs to change, update the finite canvas or fixed view and save the project. Later steps can reuse the new configuration.

Troubleshooting differences ​

SymptomWhat to check
Editor preview differs from backend exportWas the finite canvas / fixed view saved? Is the 3D fixed view enabled? Was the editing camera used by mistake?
Image edges or dimensions change after adding annotationsDid the export switch to fitting content, or recalculate the bounds automatically?
Incorrect 3D angle, zoom, or cropWere degrees confused with radians, 2D scale with 3D scale, or world coordinates with viewport pixel coordinates?
Matching composition but different pixel dimensionsCheck pixelRatio, the 2D layout scale, or the 3D full viewport and crop enable flag.
A temporary export is correct but the next step differsWere only per-export parameters overridden, without saving the new configuration to the complete project?