This series of articles focuses on the theme of "system development." Based on FORUM8's track record in system development, we will introduce various topics each time. In this 26th installment, we will introduce a CAD application that allows drawing operations to be performed within a web browser and enables centralized data management in the cloud. It is possible to build web applications tailored to specific needs.

Database-compatible CAD application "WebCAD"

Introduction

Many different web applications have been released, and they offer advantages such as being accessible from anywhere and enabling easy data exchange between users through connection to the cloud. Our company also develops various web applications, and in this case, we will introduce WebCAD, an application for creating drawings. Unlike CAD applications that run on a desktop, WebCAD can be operated directly in a browser without requiring installation. Furthermore, it connects to a database in the cloud, allowing for centralized data management, which reduces administrative costs.

WebCAD is..

WebCAD is a web application that allows users to create drawings by placing various shapes and connecting them with connectors. A key feature is the ability to assign attributes, such as those representing equipment or cables, to shapes and connectors. Examples of these attributes include "manufacturer name," "voltage," and "installation date." By utilizing these attributes, users can create wiring diagrams for electrical systems, check the connections between devices, and manage drawing history by saving drawings in a database and retrieving attribute information from the database. This also enables sharing drawings among users and automatically reflecting changes to attribute information on the drawings.

WebCAD can be flexibly configured to meet customer needs by adjusting the content of the database and the available functions.

Figure 1 shows the screen layout of WebCAD.

Figure 1: Screen layout

  1. ① Ribbon: This provides access to operations for manipulating drawings and shapes.
  2. ② Equipment List Panel: This panel displays a list of shapes that can be added to the drawing. You can add shapes to the drawing by dragging and dropping them from this panel onto the canvas.
  3. ③ Canvas: This area displays the drawing in progress. In addition to manipulating shapes, you can also zoom and scroll.
  4. ④ Property Panel: This panel displays a list of attributes for the selected shape.
  5. ⑤ Tab panels: There are tabs that provide information such as drawing names and version numbers, as well as tabs that display the results of retrieving and applying the latest attributes from a database.
  6. ⑥ Status bar: Displays messages related to processing during drawing, as well as the current zoom level.

WebCAD drawing functions

This chapter introduces the drawing-related functions of WebCAD. WebCAD uses a WebGL library called three.js[1] to render graphics.

1. Adding shapes

The shapes that can be added can be broadly divided into 2 categories: those with attributes and those without.

Shapes with attributes include rectangle elements and connector elements. Connector elements can be either single-line or have branching ends. Additionally, instead of displaying a square, rectangle elements can display an image. Shapes with attributes can have multiple terminals for connecting to other elements, and these terminals can be placed on the edges of rectangle elements or at the ends of connector elements. It is possible to connect rectangle elements and connector elements through their terminals, as well as to connect connector elements to each other or rectangle elements to each other.

Figure 2: Shapes with attributes

Shapes without attributes include text, rectangles, diamonds, right triangles, triangles, circles, lines, and leader lines. They can be used as supplementary elements for shapes with attributes, such as adding annotations.

Figure 3: Shapes without attributes

2. Editing shapes

The added shapes can be moved by dragging with the mouse, resized by grabbing their endpoints, and rotated by using the handles. Additionally, you can change the border color, background color, and line style of the border; for some shapes, you can add text, and then edit the text, adjust the font size, font type, and font color, and set options like bold, italic, underline, alignment, and rotation.

The connector automatically adjusts its shape to follow the shortest path connecting the two endpoints when they are connected. In this state, you can move the edges for fine adjustments or change them to diagonal lines. At points where connectors intersect, it is also possible to represent that they are not connected by making one of them an omega-like (Ω) shape, clearly indicating the disconnection.

You can display grid lines in the drawing screen's background. Drawing along the grid lines makes it easier to align and arrange shapes. There is also a mode that allows shapes to be moved or resized so that they fit the grid lines.

3. Drawing operations

Regarding drawing operations, you can perform actions such as zooming in and out of the drawing, changing the display area, copying, pasting, cutting, rearranging the order of overlapping shapes, undoing and redoing actions. Additionally, you can select multiple shapes, group them together, and then move or resize them collectively.

The created content can be saved in XML format. By saving the XML data to a database, it becomes possible to share the content with other users and manage change history. Additionally, the created content can also be output as images in PNG and SVG formats, allowing users to view the content even in environments where WebCAD is not available.

WebCAD's database linking function

This chapter introduces features related to attribute information and databases.

1. Shape attributes

Click on an element with attributes to select it, and a properties panel will display a list of its attribute information. You can view and edit the values in this panel. Additionally, you can select attribute information from the list and add displays of the attribute name and value directly onto the graphic. In Figure 4, a shape enclosed by a blue border is selected on the drawing, and the attributes associated with that shape are displayed in the table on the right. It is also possible to output a list of all shapes' attributes in the drawing in CSV format, allowing you to view or edit the values outside of the application, and then import the edited CSV file to apply those changes.

Figure 4: Attributes of shapes

Attribute information is retrieved from the database and applied when a graphic element is added to a drawing. It is also possible to retrieve the latest information from the database and apply it collectively to graphics that have already been added.

You can apply filters based on the presence or values of attributes. Filters allow you to display irrelevant shapes in a faded color or hide them altogether, making it possible to search for or highlight specific shapes.

2. Displaying the content processed on the server-side

There's also a feature where complex processing is performed on the server-side, and the results are then displayed within the web application.

The revision comparison feature allows you to display the differences between past versions of drawings stored in the database and the drawing currently being created. It can simultaneously display both the past version and the current version, and highlight the differences, making it easy to confirm changes.

The rule check function checks the content of drawings on the server side and lists any inappropriate areas. When you select an item from the list, the corresponding shape in the drawing will also be selected, making it easy to determine which shapes need to be corrected.

Finally,

In this presentation, we introduced our in-house developed WebCAD system. With WebCAD, by modifying the attributes managed in the database, you can create a wide range of diagrams, from large-scale drawings representing buildings and roads to small-scale drawings representing electronic circuit boards, and even non-physical diagrams like mind maps. Furthermore, it is possible to add dedicated functions tailored to specific applications. This allows us to build Web applications with databases and features that are suitable for the type of diagram you want to create. We hope you will look forward to its future development.

References and websites

[1] https://threejs.org/ (Accessed on March 14, 2024)


(Featured in the Spring issue of Up&Coming '24)



Previous page
    
Index
    
Next page


Up&Coming

LOADING