AI-Powered JSCAD Design

Use AI to help create, modify, and optimize your JSCAD code in the 3D viewer.

Beginner

What AI Can Help With

Code Generation

Describe what you want and get JSCAD code

Error Fixing

Get help debugging and fixing code issues

Design Suggestions

Get ideas for improving your designs

Code Optimization

Make your code faster and more efficient

Learning Help

Understand JSCAD concepts and best practices

Code Refactoring

Restructure code for better organization

Step 1: Access the AI Assistant

Open AI Chat

The AI assistant is available as a floating modal that can be opened from anywhere in the 3D viewer.

Look for the AI Assistant button in the interface
Type your question or request
Press Enter to send

AI Chat Modal

Floating window

Step 2: Create a Code Object

Start with JSCAD Code

Using the Toolbar

In the 3D viewer, use the Code menu in the toolbar to create new JSCAD objects.

Click "Code" in the toolbar
Select "New Code Object"
Code editor will open

Template Code

const getParameterDefinitions = () => [
{ name: 'size', type: 'float', initial: 10, caption: 'Size' }
]
function main(params) {
return cube({ size: params.size })
}

Step 3: Generate Code with AI

Describe What You Want

Good Prompts

"Create a parametric box with configurable length, width, and height. Include rounded corners and a lid."

"Make a gear with 20 teeth, 5mm thickness, and 30mm diameter. Make the number of teeth configurable."

"Create a phone stand that can hold phones from 5-7 inches. Include cable management holes."

Tips for Better Results

Be specific about dimensions
Mention materials or use cases
Include design preferences
Avoid vague descriptions
Don't assume AI knows context
Avoid overly complex requests

Step 4: Apply AI-Generated Code

Copy and Test

Copy AI Response

Copy the JSCAD code from the AI response and paste it into the code editor.

Select the code from AI response
Paste into code editor
Click Save to compile

Parameter Configuration

If the code includes parameters, configure them using the parameter modal.

Parameter modal opens automatically
Adjust values as needed
Click Apply to see changes

Step 5: Debug and Fix Errors

Get Help with Problems

Common Error Types

Syntax Errors

Missing brackets, semicolons, or typos

Logic Errors

Code runs but doesn't produce expected results

Performance Issues

Code is slow or uses too much memory

How to Ask for Help

Include the error message:

"I'm getting this error: [paste error here]"

Describe what you expected:

"I wanted a cube but got a sphere instead"

Share your code:

"Here's my current code: [paste code]"

Step 6: Learn and Improve

Use AI as a Learning Tool

Ask for Explanations

"Explain how this boolean operation works"

"What's the difference between union and intersection?"

"How do I make this more efficient?"

Request Best Practices

"What's the best way to organize this code?"

"How can I make this more parametric?"

"What are some alternative approaches?"

Best Practices

Do's

Start with simple requests
Iterate and refine gradually
Ask for explanations of complex code
Use AI to learn new techniques

Don'ts

Rely entirely on AI without understanding
Ask for overly complex designs at once
Ignore error messages or warnings
Copy code without testing it

Ready to Start?

Now try creating your own JSCAD designs with AI help!