top      Laboratory of Artificial Intelligence for Design

smart free CAD for web
The design of 2D or 3D geometries is involved in one way or another in most of science, art and engineering activities. Modern design tools are powerful and boost the productivity of designers, but they require a lot of training, effort and time to achieve a good understanding and an efficient exploitation. LAI4D is an R+D project whose aim is to develop an artificial intelligence able to understand the user's ideas regarding spatial imagination. This technology will help improve the communication between designers and design tools by emulating human cognitive abilities for interpreting graphic representations of geometric ideas and other capabilities.
The implementation has been conceived as a dual web application that can work as a 3D rendering widget or as a free light 3D CAD tool providing the adequate environment for the project. This CAD tool incorporates a special design assistant in charge of extracting conceptual geometries from pictures or sketches provided by the user as input. Additionally LAI4D tries to reduce the inherent complexity of professional design tools which, despite being suitable for experienced users, are almost unreachable for other people not trained in the usage of CAD systems and only in need of an occasional use. The selected implementation approach not only allows the users an easy access to the tool, but is also an excellent mean to build a community of designers that will provide the necessary feedback for the system in order to make it bigger and smarter. Follow this link to try the LAI4D designer.

LAI4D is a creation of Lai4d Systems


LAI4D source editorThe LAI4D widget is a simplistic 3D viewer and designer for the web all in one. This widget can be easily embedded in other web pages in the form of an IFRAME element whose URL indicates the drawing source. The viewer allows to render and explore 3D drawings in web pages without the need of plugins even if the device is not WebGL enabled. The designer is the free drawing tool for the people without the time to learn the usage of a professional CAD application and that need results in minutes. It allows to create 3D drawings by writing the description of the geometries using a really simple language. As opposed to most modern applications, direct source edition as plain text takes again relevance in LAI4D because it is straightforward for occasional and inexperienced users requiring a minimum learning effort. At the same time, the created drawings can be shared through the Internet uploading them to the LAI4D server from the own designer widget. And if a more advanced usage is required, a rich command and graphic interface is also available.

Although LAI4D has not been conceived as a professional CAD tool, it can handle any kind of design since it offers the following elements:
  • Polygonal lines and polyhedrons.
  • Spheres, cones and revolved surfaces.
  • Curved lines, pipes, organic surfaces and meshes.
  • Signals with texts and images.
  • Algorithmic shapes.
  • Molecular structures.
Additionally LAI4D offers other interesting features such as:
  • The description language Lai4dCL which is one of the simplest text based drawing formats.
  • The inheritance strategy that allows to easily define an entity or part of an entity from another one.
  • The possibility to define sub-drawings as a set of entities logically contained in another entity making the drawing to work much the same as a navigable tree of folders.
  • The possibility of attaching hyperlinks or custom user data to any entity of the drawing.
  • The extension strategy that allows to break the limits of the canonical language through the algorithmic generation of entities requiring only JavaScript knowledge from the user.
  • A free online service for file storage and retrieval that allows the immediate sharing of the created drawings through the Internet (free access, no user registration required).
  • A group of behavior options configurable through the URL or the drawing source.
  • Import and export capabilities to other drawing formats.
LAI4D designer UI
All graphic functions of LAI4D are based on the capabilities of the canvas HTML element. Although major web browsers are compatible with WebGL there are still many devices not WebGL enabled so they cannot benefit from accelerated graphics hardware for rendering 3D geometries. Fortunately LAI4D is built over the Lai4d Systems' Iquix framework whose drawing module is able to work both with WebGL and canvas 2D rendering contexts. Obviously the performance when using canvas 2D is less than that when using WebGL but, at least, it allows to handle 3D geometries in any device.

LAI4D can be used not only online but also offline. The LAI4D web page downloaded from the Internet can be saved to a local drive of the client's machine using the standard "Save as" function of the web browser normally located in the "File" menu. This will allow the user to work offline regardless of whether the LAI4D page has been cached or not by the browser. This is particularly necessary if the user wants to create a distributable HTML document containing embedded LAI4D drawings as IFRAME elements that can be displayed both online from the Internet or offline from the local drive of a computer.

The user interface is structured in order to allow an easy access to the functions. The most common functions are grouped at the corners of the viewport while the rest of functions and configurations are organized in a tree view control.

The design assistant available in the designer widget is an experimental tool intended to provide a new way of communication between the user and the design application. Its goal could be explained as the capability of understanding the user ideas. When the assistant analyzes a user's input, what it is essentially doing is trying to understand that input in order to generate a canonical or formal response ready to be exploited for design purposes. The tool can be basically used in two ways:
  • Entering a text string in order to be parsed obtaining the corresponding formal data structure, or in order to find help about a topic.
  • Making a sketch or uploading a picture in order to obtain the corresponding conceptual geometry after a heuristic interpretation process.
The sketch interpreter of the design assistant is the face of the conceptualizer program JAIC. The goal of this program is to "imagine" the conceptual geometry represented by an imprecise raster image in a probabilistic way regardless of whether it is a recognizable shape or not. The sample image shows a set of irregular strokes at the left side, and it is what it is, a sketch with irregular strokes. Despite of their imprecision, a person could also say that the strokes represent a box, like the one at the right side. The necessary process to reach to the conclusion that those irregular strokes are representing a perspective view of a box is a conceptualization process. While a box is a well-known shape, the conceptualization can also be extended to the comprehension of non-recognizable and never-seen-before geometries when such geometries have some kind of sense.
JAIC is progressively implementing the necessary knowledge to try to understand the 2D or 3D conceptual geometry represented by sketch images under certain conditions. When the analysis is successful the program generates the corresponding canonical geometric entities offering the possibility of adding them to the drawing. Although the current capabilities of JAIC are still very limited its potential is great. Traditionally humans share complex ideas through plans, sketches or other graphic means because they are more efficient for transmitting the huge amount of information needed to describe such ideas. Unfortunately this strategy does not work so efficiently when the recipient is a machine since it usually demands the information in a canonical format. But, what if the machine were able to understand the user's ideas? That is the way LAI4D is trying to open by developing JAIC.
This technology is absolutely experimental and is at a very early stage of development. A big effort has been done for implementing the first versions as a client side application offering useful offline capabilities, but this cannot be a long term strategy due to the limited power of personal computers. In the future most of its functionality will run on remote servers better fitted for executing the heavy queries and brute force algorithms involved in artificial intelligence tasks.

The detailed functionalities of LAI4D can be found in the reference manual at the documentation section.


Click on the image links to open the samples in a new window. Some of them may take several seconds to render. All details about the entities used to compose these examples can be found in the reference manual at the documentation section.

Paper airplane
A very simple geometry representing a paper airplane.
It is composed of a single polynet with 4 faces.
No styles are used so default colors are applied.
This example composed of a single "curve" entity representing a human face profile demonstrates the versatility of this type of entity. If two consecutive vertices are equal then the corresponding segment evaluates to a single point. If two consecutive vertices are equal and the next two consecutive vertices are also equal then a straight segment is generated between the two pairs of vertices. Thanks to this the "curve" entity can represent linear geometries with corners mixing straight and curved segments.
In this case all the vertices of the curve are placed at the same plane so it is a 2D geometry, but the "curve" entity also accepts 3D vertices. If the vertices of a regular hexagon are used as vertices of a closed "curve" entity, then the obtained geometry looks much like a circle.
The example is composed of a "pipe" entity. This type of entities are defined by a profile and a guideline, and both can be either open or closed. Organic surfaces may take several seconds to render.
Profiles or guidelines can mix curved and straight segments and can have corners since they are defined through the same algorithm used for the "curve" entity. A profile can be defined by a set of 3D points so does not need to be plane.
The profile is assumed to be referenced to the origin {0,0,0} and to the orientation defined by the Z axis. The surface is built by translating copies of the profile from the origin (reference point of the profile) to the points of the guideline and, at the same time, reorienting the profile copy making the reference Z axis tangent to the guideline.
Extruded surfaces can be generated using a straight segment as guideline.
This design is an example of the use of "patch" entities. There are only two original surfaces: one patch for the delta wing and other patch for the air intake. The rest of surfaces are obtained by means of symmetries from the two previous ones. Note how the border lines of the patches can be either straight or curved lines. Organic surfaces may take several seconds to render. Some lines have been used to decorate the drone.
There is a hidden entity (a tri-axis only used as reference and placed at the zone of the outlet nozzle) with an attached sub-drawing containing auxiliary entities used during the design.
Curve inherited from line
This is an illustrative example of the use of inheritance. Inherited entities must have a "name" member while heir entities must have an "inherit" member indicating the name of the entity from which to inherit. All members of the inherited entity will be "copied" to the heir entity with the exception of those already present in the heir entity which will be preserved.
The drawing contains a "line" entity whose name is "a" defined by 6 vertices each of which has been assigned a color.
The drawing also contains a "curve" entity whose definition is inherited from that of the entity named "a", the "line" entity, so it passes through the same vertices.
Note how the line is open while the curve is closed because the curve has a member "closed" set to a non-zero value.
Tetrahedron with signals
This example is composed of a single polynet that incorporates the four available types of signals. All the signals are anchored to the same vertex. The polynet has a member "link" (attaches a link) that points to the drawing itself so, when navigated, the same drawing is opened in a new window.
The dot signal is placed directly over the anchored point. The polygon signal is used as a leading line joining the vertex and the text. The text signal has an offset with respect the vertex. The source of the image signal has been codified in Base64 instead of using its path so it is not an external resource but an internal one.
Spiral screw
This is an example of a "revolved" entity. By default this type of entity builds a surface of revolution with the given profile around the Z axis, but it can optionally be a screw like surface providing the "advance" member, as it is done in this example.
Profiles can mix curved and straight segments and can have corners since they are defined through the same algorithm used for the "curve" entity. A profile can be defined by a set of 3D points so it does not need to be plane.
In this case the profile curve represents a 3D spiral.
Cones and cylinders can be generated using a straight segment as profile.
Organic surfaces may take several seconds to render.
This example represents a simplified distribution of the walls of a house. Each wall is composed of a single "face" entity, even those with windows. The trick to build a face with holes is to consider the borders of the holes as borders of the face. In theory, the vertices of a face should be in the same plane but LAI4D does not perform any checking. It simply projects the vertices and paints the corresponding polygon which may seem strange if that set of vertices is not well constructed. The black lines are auxiliary and can be hidden, they are not part of the faces. One of the walls defines the wall color and the other ones inherit it. The selected color is semitransparent.
This drawing includes a view definition and a configuration for avoiding the camera inclination.
Algorithmic snail
The geometry represents a multicolor snail shell. It is obtained through a "program" entity that contains the generator algorithm. The section, the number of revolutions and colors can be passed as arguments using the member "variable". This "program" entity has a sub-drawing attached that contains the definition of the curve used as section. The result of the algorithm is a single polynet composed of colored faces. The drawing source is not very long but the execution of the algorithm can take several seconds.
It is impossible for a CAD system to provide a set of predefined entities suitable for all imaginable uses. The "program" entity solves this limitation allowing the generation of geometries according to a customized algorithm.
Random city
A "program" entity generates a set of "box" entities that looks like a city.
The user can provide the ground width, the ground length, the maximum box height and the number of boxes through the "variable" member. The greater the number of boxes is, the longer the time to render will be.
The algorithm randomly decides box sizes, positions and colors trying to set greater box heights at the center of the ground area. Each time the entity is rendered a new distribution is obtained due to the usage of random functions.
As any other entity, the result of a "program" entity can be converted into polynets using the corresponding function in the LAI4D designer.
This drawing is an example of how "molecule" entities can handle a great number of atoms efficiently from a rendering point of view. It corresponds to a fantasy molecular structure built from four regular dodecahedrons and using four atom types randomly arranged.
The atoms painted by a "molecule" entity are not real spheres but signals composed of images and circular dots which notably reduces the graphics load. In LAI4D molecules can also show the atom symbols and each atom can have either default color and radius or customized ones. The color of the atom links is also configurable. The background color has been made black in order to obtain a better contrast.
In this case the link opens an HTML page with the LAI4D widget embedded in an IFRAME, instead of showing directly the widget's page. The parent page defines a background image which can be seen because the widget is transparent. The model represents a fancy fish composed of colored patches, spheres, filled curves and symmetries. Inheritance is also used.
When a linear entity like a "curve" defines the member "fill" with a non-zero value, it is represented as a face. This strategy is used for some of the fish's fins.
Multi-view device
The link opens an HTML page showing 4 views of a device. The HTML page contains a table with 4 cells. Each cell contains a LAI4D widget embedded in an IFRAME with a customized URL.
The URL start-up instructions of all the IFRAME elements point to the same file which defines the device's model. In return, the different view configurations used for each widget are passed using the member "append" of the start-up instructions. This member adds the passed entities (a single view definition in this case) to the drawing source before it is interpreted.
The geometry of this spider has been imported from a .PLY file found at: (Greg Turk)
Once imported, a color and a curved face effect has been applied.
The currently supported import and export capabilities are covered by the functions under the "File" menu of the LAI4D designer.
The geometry of this trumpet has been imported from a .OBJ file found at:
Once imported, a color and a curved face effect has been applied.
The currently supported import and export capabilities are covered by the functions under the "File" menu of the LAI4D designer.
Interpolated tetrahedrons
Two similar "program" entities generate artistic representations of tetrahedrons using the function "AppLai4d.GInterpolate".
The algorithms draw lines joining the segments of the tetrahedrons using simple linear interpolation to get the line points and point colors. One of the algorithms distribute the lines regularly while the other one makes it randomly.
Fractal 1
A "program" entity that generates a 3D fractal geometry composed of regular tetrahedrons.
In each iteration a new tetrahedron is placed at each free face of the tetrahedrons created in the previous iteration. The three vertices of the contact face of a new tetrahedron are obtained by linear interpolation from each of the three edges of the contact face of the old tetrahedron. An optional list of colors can be distributed among the resulting vertices.
The number of iterations, the interpolation parameter and the optional list of colors can be configured through the "variable" member.
This entity is another example of the usage of several functions provided by the JS object "AppLai4d" for designing algorithmic entities.
Fractal 2
Another example of "program" entity generating a 3D fractal geometry composed of regular tetrahedrons.
In each iteration a new tetrahedron is placed at certain distance of each vertex of the tetrahedrons created in the previous iteration. The new tetrahedrons are scaled and rotated. An optional list of colors can be distributed among the resulting vertices.
The number of iterations, the distance factor, the scale factor, the angle and the optional list of colors can be configured through the "variable" member.
In this case the functions provided by the JS object "AppLai4d" have been used in the optimized way minimizing the number of arrays to be created in each operation.


Beginner's tutorial: This tutorial is the recommended introduction for all persons new to LAI4D. It is intended to teach the basics of design in 20 minutes. It shows step by step how to create a simple 3D geometry from the idea up to the publishing of the drawing on the Internet using the easiest tools. Thanks to this exercise the user will understand the working philosophy of LAI4D, will be able to generate polyhedral surfaces and polygonal lines with colors, and will learn to share designs through the free online sharing service of LAI4D. The created geometry can be inspected in the link: cubicle_sample.

UI quick help: This help document summarizes the functions available through the user's interface of the viewer widget.

Reference manual: This document is the most complete guide to the functions of the LAI4D widget but it is not a tutorial. It is indicated for people willing to make a more deep usage of the tool. The following topics are covered by the reference manual:
  • Lai4dCL. The language used for describing the source of LAI4D drawings and other data structures. Syntax, inheritance strategy, entity model, sub-drawings...
  • The standard and the extended entity sets. It explains the structure and properties of the different entity types available to compose LAI4D drawings. Polynets, lines, surfaces, transformations, algorithmic entities, molecules, view definitions...
  • User interface. This section explains the usage of the functions available through the LAI4D's UI. View control, file management, configurable options, edition and query operations, design assistant...
  • Publishing LAI4D drawings. Sharing of drawings, configuring start-up instructions through the URL, offline usage...
  • LAI4D architecture. Additional information for achieving a better understanding of the LAI4D functions and limitations.


+ What can I do with LAI4D?
LAI4D widgets allow to render, explore and edit 3D drawings in web pages without the need of plugins. The designs can contain lines, surfaces, texts, images... The drawing sources can be edited as plain text using a really intuitive language. Additionally LAI4D implements an amazingly simple strategy for generating algorithmic entities. Furthermore, the created drawings can be immediately shared through the Internet uploading them to the LAI4D server from the own widget.
+ Where do I start?
Visit the documentation section. There you will find tutorials and reference manuals. The "Beginner's tutorial" is designed to learn in 20 minutes how to create a basic 3D design from the idea up to the publishing of the drawing on the Internet.
+ Is LAI4D free?
Yes. The standard LAI4D widget, both viewer and designer, can be used for free as is without modifications. It can even be downloaded and used offline if necessary. The function for storing drawings in the LAI4D server is also free and no registration is required.
+ Is LAI4D open source?
Not currently, although this option is not discarded for the LAI4D project in the future.
+ Could the LAI4D widget be customized?
Lai4d Systems can customize the LAI4D widget changing aspect, functions and behavior according to the client requirements. Contact Lai4d Systems for more information about this possibility.
+ Is there any API for exploiting the LAI4D functions programmatically?
The LAI4D widget allows the passage of start-up instructions through the URL, see the "Widget initialization" section of the Reference manual for more details. Although it is not an API, LAI4D implements an entity type called "program" that allows the algorithmic generation of graphic entities through JavaScript programming. A public JavaScript API could be released in future versions of LAI4D.
Lai4d Systems can provide consulting and development services for customizing or integrating the LAI4D functionality in other software.
+ Can the LAI4D widget work with other drawing formats?
The currently supported import and export capabilities are covered by the functions under the "File" menu of the LAI4D designer.
+ How can I send error reports, suggestions or queries to the LAI4D team?
User participation is centralized through the "LAI4D's community blog". Error reports, suggestions or general queries can be posted there where members of the LAI4D team or other users will reply a.s.a.p.
+ What is a polynet?
It is the intrinsic graphic entity of LAI4D. A polynet defines a set of vertices, a set of faces, a set of lines and other properties for colors or line widths for example. Any other type of graphic entity is to be converted into a polynet or a set of polynets during the interpretation process before it can be rendered.
+ Why is so easy to use algorithmic entities?
What a "program" entity does is essentially to execute a JS algorithm that returns a standard LAI4D entity that can then be rendered in the usual way. The Lai4dCL syntax is so simple that a LAI4D entity can be immediately converted into a JS array or vice versa. Thanks to this characteristic the result of the "program" entity can directly be a JS array instead of a Lai4dCL structure so there is no need to deal with specific APIs to generate algorithmic entities. This advantage combined with the fact the LAI4D entities have a very intuitive format make "program" entities really easy to use.
+ Which is the difference between shape recognition and shape conceptualization?
A shape recognition process attempts to find a match for the analyzed image (or other input) within a shape descriptions data base returning as result the found record if any. However, a shape conceptualization process attempts to "imagine" the shape represented by the analyzed image regardless of whether it is a recognizable shape or an abstract one returning the imagined shape's geometry as result.
+ How can I get involved in the project?
The easiest way to get involved is to become an expert user in order to participate in the community helping other users, writing tutorials and providing feedback to the LAI4D development team.


The community is a space intended for cooperation between LAI4D users and developers. All users participating in the community are helping the project in one way or another. To answer questions, to report a bug, to write a tutorial, to share a useful algorithmic entity or to discuss an enhancement proposal, all are welcome contributions. After being evaluated by the LAI4D development team, this feedback will become into software and documentation improvements. By participating in this community you also accept the terms and conditions expressed in the section NOTES.
Remember that the most common errors and problems are explained in the corresponding section of the Reference manual.
If you simply want to report a bug or to denounce an improper usage of the online services, you can also contact to the development team at

Access to the LAI4D forum


This web site does not store information in the user's web browser.
Copyright 2016-2017 Lai4d Systems. All Rights Reserved.
LAI4D, Iquix, Gosyx and JAIC are trademarks or registered trademarks of Juan Andrés Hurtado Baeza.
For administrative inquiries regarding LAI4D, please contact Lai4d Systems.

+ License, terms and conditions
LAI4D, Iquix, Gosyx, this web site and accompanying documentation constitute a software system (the "Software") subject to the following license agreement. By using this Software, you accept these terms. If you do not accept them, do not use this Software:

The Software is free for use in any environment, including but not necessarily limited to: personal, academic, commercial, government, business, non-profit, and for-profit. "Free" in the preceding sentence means that there is no cost or charge associated with its use. Permission is hereby granted, free of charge, to any person obtaining a copy of the Software, to use the Software without restriction, including the rights to use, copy, publish, and distribute the Software, and to permit persons to whom the Software is furnished to do so.

You shall not sell, rent, lease or sublicense the Software or any part thereof. You shall not modify, adapt, or translate the Software. If you create derivative works based upon the Software or use the Software as a component of other system, provided the Software is not modified, you shall not alter its appearance neither hide its presence or any of its features. If you create a web site offering copies of the Software you shall clearly indicate that it is a mirror site and publish a link to the official web site. You shall not reverse engineer, decompile, deobfuscate, disassemble, or otherwise attempt to discover the source code of the Software. You shall not alter or remove any copyright or other proprietary notice that appears on or in the Software.

The Software incorporates an Internet-based service named COMMUNITY providing a space for cooperation between users and developers. The Software incorporates an Internet-based service providing free online capabilities for file storage and retrieval. The content may be submitted by anonymous users and it is not offered any kind of warranty over it. The submitted content will be publicly available. The integrity or accessibility of the content cannot be indefinitely warranted. The person submitting the content shall be the author or shall have the necessary permissions to submit it. The author of the submitted content renounces to any exclusive right over it that becomes of public domain.

You shall not use the Software, including Internet-based services, for illegal or offensive purposes.

The functions of the Software, including Internet-bases services, may be changed or canceled at any time without previous notice.

If any part of this agreement is found void and unenforceable, it will not affect the validity of the balance of this agreement, which shall remain valid and enforceable according to its terms.

This legal notice shall be included or linked in all copies of the Software.


+ Release notes
The command "Create polygonal" has been replaced by the command "Create line" for creating 'line' entities.
New command "Create face" for creating 'face' entities.
New command "Create box" for creating 'box' entities.
The "Tree explorer" component is improved by adding a button for inspecting the parent node, and a button for inserting new nodes before the current one.
Now the command "Copy entities" can copy the same selection to multiple destination points.
The "Explode entities" command has been improved including the new in-place configuration "create 'face' and 'line' entities instead of polynets".
A new command "Concatenate lines" has been implemented. It is useful for generating a single line from a group of different connected lines.
The recognition of polyhedrons of the "design assistant" has been improved.
A progressive zoom function has been implemented for the Zoom-in and Zoom-out buttons of the top-right corner. The progressive zoom can be performed applying a long-press event over the buttons. The traditional stepped zoom function is preserved.
Some vector and geometric calculation functions have been added to the JS object "AppLai4d" in order to enrich and facilitate the development of algorithmic entities. See the "program" entity section in the Reference manual for more information.
The command "Merge Entities" allows now to decide whether to merge the vertices or not.
Official file extension for LAI4D drawings is ".L4D".
Implemented import/export capability to ".ply" (point cloud) format.
Implemented import/export capability to ".obj" format.
New member "append" added to the URL start-up instructions. The "append" member is intended to let the user to modify the drawing source from the URL before it is interpreted.
Improved user interface for the creation of polygonal entities.
Icon size of on-screen controls increased.
Initial version.

contador pagina web