A parametric staircase generation method based on SketchUp

By using parametric algorithms using HTML, JavaScript, and the Ruby API in SketchUp, stair models are automatically generated, addressing the inefficiency and error-proneness of traditional 3D modeling software in stair design. This enables efficient and accurate stair model generation, meeting the operational needs of the BIM industry.

CN119442424BActive Publication Date: 2025-09-23ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411582093.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-09-23
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

Traditional 3D modeling software is inefficient and error-prone when generating and managing complex stair models, making it difficult to quickly generate models that meet actual needs. This is especially true in architectural design, where the design process is complex and time-consuming.

Method used

This paper provides a parametric staircase generation method based on SketchUp. Through an easy-to-interact UI panel written in HTML and JavaScript and a parametric model algorithm written in Ruby, it automatically generates stair models, including components such as stair landings, stair railings, and clear height volumes, to meet the operational needs of the BIM industry.

Benefits of technology

It significantly improves the efficiency and accuracy of stair model design, reduces design time, meets the complex needs of modern architectural design, and avoids conversion problems between models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119442424B_ABST
    Figure CN119442424B_ABST
Patent Text Reader

Abstract

The present invention discloses a parametric stair generation method and device based on SketchUp, which is a parametric panel constructed using HTML / CSS and JavaScript and a parametric stair generation algorithm based on the SketchUp Ruby API designed in SketchUp. The present invention is a parametric stair editing based on history, which binds parameters to models, so that the generation parameters of old models can be retained and identified, allowing the production parameters of the model to be obtained when transferring drawings between different users, and can edit the parameters of the old model to generate a new model while retaining the user's external operations (movement and rotation of the model, etc.). The present invention can generate various types of stair segments including double-run stairs, scissor stairs, PC stairs, steel ladders and bicycle ramps. After opening the parametric panel, the stair segment name, floor name, stair segment type, general parameters and stair segment specific parameters can be set respectively to generate the stair segment with one click, so as to avoid the time-consuming and complicated manual modeling process and greatly speed up the design process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial three-dimensional model generation, and in particular to a parameterized staircase generation method based on SketchUp. Background Art

[0002] With the widespread adoption of 3D modeling technology in fields such as architecture, engineering, and manufacturing, the efficient generation and management of complex 3D models has become a critical issue. Traditional 3D modeling methods often require manual adjustment and creation of models, which is not only time-consuming and labor-intensive but also prone to errors. In architectural design, especially when working with multi-story buildings and complex structures, designers must frequently create and adjust stair models to ensure accuracy and operability.

[0003] However, traditional modeling software, such as SketchUp, while widely used for 3D modeling, still has limitations when generating and managing complex stair models. For example, stair design involves multiple parameters, such as step height, step width, and number of steps. Adjusting these parameters often requires manual work, and each modification may require recreating the model, which is inefficient and prone to errors. Furthermore, traditional methods struggle to quickly generate models that meet actual needs for different floor levels and different types of staircases, making the design process complex and time-consuming.

[0004] To address these issues, parametric design methods are gaining increasing attention. By linking design elements with variables and rules, parametric design can automatically generate and adjust models, significantly improving design efficiency and accuracy. Against this backdrop, a parametric staircase generation and utilization method based on SketchUp has been developed. This method, capable of automatically generating staircase models that meet various requirements, significantly reduces design time while also improving model accuracy and consistency, thereby meeting the increasingly complex demands of modern architectural design. Summary of the Invention

[0005] This invention addresses the shortcomings of existing technologies and, based on parametric modeling, provides a method for generating and using parametric staircases in SketchUp. This method provides an easily interactive UI panel written in HTML and JavaScript, and a parametric modeling algorithm written in Ruby. This allows users to accurately and quickly construct desired staircase models based on predefined parameters. This method addresses the inefficiency and error-proneness of traditional 3D modeling software in staircase design, and meets the operational requirements of the BIM industry.

[0006] The object of the present invention is achieved through the following technical solution: a parametric staircase generation method based on SketchUp, comprising the following steps:

[0007] (1) Open the parametric panel, edit and design the stair segment parameters, click Apply, and use JavaScript to package the data into a specific JSON format and pass it to the parametric stair segment generation algorithm written in the SketchUp Ruby API;

[0008] (2) After obtaining the designed JSON parameters, the global stair parameters and the specific parameters of the stair sections based on the floor can be obtained from them. The parametric generation class of the stair sections is initialized according to the global stair parameters to mark the components to be generated, and the old model and view information in SketchUp are recorded at the same time; the specific parameter data of the stair sections are sorted from low to high according to the floor, the parameters are recorded and the relevant parameters for filling the connected stair section platforms and determining the location of the generated stair sections are initialized;

[0009] (3) Take the lowest floor data that has not been generated from the specific parameters of the stair segment, read its universal stair parameters, and obtain the number of stair segments on the current floor; traverse the num stair segment parameters in the current floor, update the specific parameters of the current stair segment each time, and call different stair segment parameterization generation algorithms for different stair segment types, add the generated stair segment to the generation result list, and at the same time generate and fill the connected stair segment platform according to the generation result of the previous stair segment, and add it to the generation result list; and merge the list into a stair segment group for subsequent processing;

[0010] (4) Select "Generate all floors" to view the floor names, where the floor names are x~yF. Copy the stair group generated in step (3) upwards yx times and name them according to the floor names.

[0011] (5) Repeat steps (3) and (4) until all floors are generated; generate floor plans and top extension platforms, and merge them into one group to obtain a total model containing all models; if there is an old model, move the total model to the old position, and finally complete the generation of the parametric stair section.

[0012] Furthermore, the step (1) is implemented by the following sub-steps:

[0013] (1.1) Click the parametric generation panel icon to pop up the parametric staircase UI panel;

[0014] (1.2) Check whether there is a selected model in SketchUp. If there is a selected model and the model is a stair segment generated based on SketchUp's parametric stair segment, the parametric generation data stored in the model is read and passed to the parametric panel constructed by HTML / CSS and JavaScript. JavaScript is used to read the parameters and display them. If no model is selected or no data is read, the parametric panel will be the default parameters.

[0015] (1.3) After editing the parameters, click the Apply button. The parameters in the panel will be converted into specific JSON format data and transmitted to the parametric stair generation algorithm written in the SketchUp Ruby API.

[0016] Furthermore, the step (2) is implemented by the following sub-steps:

[0017] (2.1) After obtaining the JSON data in step (1), initialize the stair segment parametric generation class object and read the stair segment global generation parameters, including whether to generate the evacuation radius volume, whether to generate all floors, whether to have a top extension platform, and whether to need floor display;

[0018] (2.2) Traverse the existing models in SketchUp to find out whether there is a ladder with the same name. If so, record the transformation matrix of the model; if not, set the transformation matrix to the unit matrix; and record the current layer status in SketchUp to restore the layer display and hiding in SketchUp after the subsequent generation is completed;

[0019] (2.3) Identify the floor names in the data and sort the parameter data by the floor names in descending order to form an order similar to [B3~B2F, B1F, 1F, 2~5F, RF];

[0020] (2.4) Maintain a standard point for model generation. After the stair segment model is generated at the origin, the model can be placed in the correct position by transforming it with reference to this standard point. The model is updated according to the stair segment parameters each time a stair segment is produced. At the same time, the data structure used to record the width, length, height and platform length of the previous stair segment is initialized to generate a connection component.

[0021] Furthermore, step (3) is implemented by the following sub-steps:

[0022] (3.1) Take the lowest floor data that has not been generated and read its general stair parameters, including stair type, stair height, stair width, step height, step width, and total number of steps;

[0023] (3.1) Get the number of stair sections num, that is, the floor is composed of num stair sections. If the stair section type of the floor is a scissor stair, then the floor is composed of 2*num stair sections.

[0024] (3.2) Read the stair parameters in sequence according to the stair number, call different stair parameterization generation algorithms according to the stair type, and update the model generation standard points; normally, a stair group contains a staircase and surface layer, two platforms and surface layers, clear height volume and railings; if it is a double-run staircase, generate a zigzag wireframe on the side of the stair according to the number of steps, step width and step height, and then push and pull it into a stair according to the stair width; the stair surface layer and platform are produced in the same way; the positions of different components are derived from the given parameters; if it is a scissor staircase, it is necessary to apply a mirror matrix to the original stair group based on the double-run staircase, and obtain the stair group on the other side according to the stair width offset;

[0025] (3.3) Whenever a staircase is generated, the missing platforms caused by the stairwell need to be filled;

[0026] (3.4) Put the models generated in steps (3.2) and (3.3) into the generated result list in turn to form groups, and obtain the floor stair model of the first floor.

[0027] Furthermore, step (4) is implemented by the following sub-steps:

[0028] (4.1) Check whether the global parameter is set to "Generate all layers". If so, proceed to step (4.2); otherwise, end step (4);

[0029] (4.2) Check whether the current floor name is in the format of "X~YF". If so, it means that the same parameters are applied to all floors from XF to YF. The floor stair model of the XF floor generated in step (3) needs to be copied upwards.

[0030] (4.3) In order to obtain the floor stair model of X+iF, it is necessary to copy the floor stair model of the XF layer and offset it upward by the height of i stairwells to obtain the floor stair model of X+iF.

[0031] Furthermore, the step (5) is implemented by the following sub-steps:

[0032] (5.1) Repeat steps (3) and (4) according to the number of floor names obtained to generate all models into groups;

[0033] (5.2) Group all the models generated in step (5.1) to obtain the total ladder model;

[0034] (5.3) If "Floor Display" is selected, a transparent plane will be constructed at the initial height of each floor to indicate the floor according to the number of floor initial height groups; if "Top Extended Platform" is selected, a symmetrical stair landing plate will be generated on the other side of the top platform;

[0035] (5.4) Merge the total stair segment model in step (5.2) and the other models in step (5.3) to obtain the final stair segment model group;

[0036] (5.5) Apply the transformation matrix obtained in step (2.2) to the final stair model, store the JSON data generated in step (1.3) in the model, and restore the view.

[0037] The benefits of the present invention are as follows:

[0038] During the parametric generation process, the present invention incorporates a set of parametric panels constructed using HTML / CSS and JavaScript. This panel provides a user-friendly, easy-to-use, and simple way of interacting with the program, allowing users to accurately and quickly construct the required stair model based on the set parameters, thereby greatly accelerating modeling efficiency and improving modeling accuracy. At the same time, the present invention uses a set of parametric stair generation algorithms based on the SketchUp Ruby API, which can directly generate models in SketchUp using the parameters provided by the UI panel, avoiding the problem of conversion between models. The algorithm can generate stair models and various stair-related components including stair platforms, stair railings, net height volumes, stair surface layers, etc., meeting actual usage requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a framework diagram of the method for generating and using parametric stair steps based on SketchUp;

[0040] Figure 2 The present invention uses HTML / CSS and JavaScript to build a parameterized UI panel diagram;

[0041] Figure 3 It is a schematic diagram of the net height volume generated by the present invention;

[0042] Figure 4 Schematic diagrams of stair models generated by the present invention are, from left to right, double-tread stairs, scissor stairs, and PC stairs;

[0043] Figure 5 This is the generated stair model of the present invention, which shows a steel ladder and a bicycle ramp from left to right. DETAILED DESCRIPTION

[0044] To help those skilled in the art better understand the present invention, the following clearly and completely describes the technical solutions in the embodiments of the present invention, in conjunction with the accompanying drawings. Obviously, the described embodiments are only a portion of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort should fall within the scope of protection of the present invention.

[0045] It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.

[0046] like Figure 1 As shown, a method for generating and using parametric stair segments based on SketchUp includes the following steps:

[0047] Step 1: Open the parameterized panel, edit the panel, and click the "Apply" button to construct the UI panel data into JSON data and transmit it to the parameterized generation algorithm.

[0048] Step one is the technical basis of the present invention. It uses structured JSON data as the processing unit, which fundamentally meets the operational requirements of parameterized generation. In addition, the UI panel in step one is one of the core invention parts. It constructs a clear and interactive UI panel to avoid usage difficulties and greatly speed up the design process.

[0049] The step 1 includes the following sub-steps:

[0050] (1.1) Use HTML / CSS and JavaScript to build parameterized UI panels, such as Figure 2 A series of rules are set in the panel, such as the clear height of the stair section must not be less than 2000, the step height is equal to the height of the stairwell divided by the total number of steps, and the options of double-run staircases and scissor ladders are mutually exclusive.

[0051] (1.2) When you click the parameterized panel, a UI::HtmlDialog object dialog is constructed in SketchUp. This object is bound to the HTML file in step (1.1) and a series of callback actions are set for the dialog so that the HTML dialog can call the Ruby method in SketchUp.

[0052] (1.3) After the dialog is generated and initialized, it checks to see if a model with parameterized data is currently selected. It then extracts the parameterized data and uses the execute_script method to execute the JavaScript in the HTML to populate the panel. When setting the rung name, a Ruby method in SketchUp is also called back to ensure there are no duplicate names.

[0053] (1.4) After editing the parameters and clicking "Apply," the HTML will package the panel data into a specific JSON file. This JSON file consists of two main sections: "uidata," which stores the UI panel data, and "stairdata," which is used to generate the model. The data in "stairdata" is organized by floor, with the key being the floor name and the value containing general stair parameters for that floor (number of flights, tread width, total number of steps, tread height, etc.) and specific parameters for each flight (number of steps, flight height, and various offset values). Once the JSON is generated, JavaScript passes it to Ruby, which then invokes the parameterized stair generation algorithm.

[0054] Step 2: Process the JSON data submitted in Step 1, read the UI panel data, and set global parameters based on the global settings to control the subsequent parametric generation process. Then, based on the stair run name submitted by the user, search for objects with the same name in the current workspace and record the current status of the objects. This also provides preprocessing support for the subsequent parametric generation algorithm, including floor sorting, locating standard generation points, and showing and hiding components.

[0055] Step 2 is a connection between step 1 and step 3. After obtaining the JSON data of the UI panel, the data is preprocessed, which includes the following sub-steps.

[0056] (2.1) First, uiData is extracted from the incoming data, which contains the parameters set by various UI panels, including the name of the stair section, floor configuration, and other signs and parameter information required for generation. The system will perform a series of initialization operations based on these parameter configurations (global stair parameters and specific parameters of the stair section based on the floor unit can be obtained from them, and the stair section parameterization generation class is initialized according to the global stair parameters. The stair section parameterization generation class is a class used for parametric generation. This class needs to determine which components need to be produced based on the global stair parameters, and the floor stair section parameters are required for the subsequent algorithm generation.), including setting the stair section name and various landmark parameters, such as generating signs for all floors, whether to generate the evacuation radius volume, and whether to extend the top platform parameters.

[0057] (2.2) Before generating the stair, the system will traverse all group objects in the current SketchUp model to check if there is a model group with the same name as the current stair. If a stair group with the same name is found, the system will record its transformation matrix and obtain the inverse transformation matrix (if any) and Z-axis offset value associated with the group. To avoid naming conflicts, the found stair group will be renamed to the original name with the suffix "old".

[0058] (2.3) In floor data processing, the system parses the floor configuration from the incoming uiData and sorts the floors according to their height. This sorting process ensures that the generated staircases are generated in order from low to high, thus meeting the actual requirements of the building design.

[0059] (2.4) To ensure consistent stair segment generation, the system maintains a standard generation point, which is used to determine the initial position of each stair segment. After each stair segment is generated, the system updates the position of the standard point based on the stair segment's width, length, height, and other parameters. At the same time, the system initializes a data structure to record the parameters of the previously generated stair segment. These parameters will be used when generating connected components.

[0060] (2.5) During the generation process, the system will save the layer display status of the current SketchUp model and set all layers to be visible for subsequent model processing. After the generation is completed, the system will restore the original layer display status to maintain the overall consistency and operability of the model.

[0061] Step 3: Read the floor data processed in step 2, take out the lowest ungenerated floor, read the parameters of all the constructed stair sections, and generate the stair sections in sequence from bottom to top according to the parameters of each stair section; for each stair section, starting from the initial generation point, construct the stair section body, clear height volume, handrails and other components respectively. After all components are generated, group them and use matrix transformation to obtain a complete stair section model.

[0062] Step three, the second core invention, essentially represents the parametric generation process. In this step, all components are generated at the origin. After the components are parametrically generated, the relationship between the standard production point and the origin is used to determine whether flipping or other operations are required. This matrix is ​​then applied to the generated stair model, resulting in a final model with the correct position and orientation. The standard production point is then updated, avoiding the inconvenience of directly manipulating stair orientation and height during parametric generation.

[0063] The step three includes the following sub-steps:

[0064] (3.1) The system first initializes the height, width, and depth of the stair segment, sets the initial X-axis offset, and reserves platform parameters for the generated stair segment. These parameters will be used for subsequent stair segment generation and adjustment of the stair segment's orientation.

[0065] (3.2) The system traverses the user-defined floor array and generates stair segments for each floor in sequence. For each floor, the system generates and copies stair segments based on the floor number and parameters. The logic for generating stair segments is as follows:

[0066] (3.2.1) Generate the main body of the stair segment. The main body of the stair segment is divided into the surface layer part and the stair segment entity. First, you need to set different generation methods according to the given stair segment type. For steel stairs, we only need to generate the surface layer part, and for PC stairs, we only need to generate the entity part. Next, we will describe the generation of the entity part. The stair segment body generation algorithm starts from the origin ORIGIN (0,0,0), walks one step height along the Z axis to (0,0,stepHeight), and then walks one step width along the Y axis to (0,stepWidth,stepHeight) to get a step. This process will loop according to the given number of steps num. Each loop will generate a riser and a tread, and finally form a jagged line segment shaped like the upper side of the stair segment body. The end point of this jagged line segment will be at (0,0+num*stepWidth,0+num*stepHeight). In order to make the stair segment and the platform plate smoothly connected, it is necessary to calculate the top beam offset and the top beam offset according to the parameters. After the top beam offset, go down one platform plate thickness to get the upper end point of the stair segment's hypotenuse, and the same goes for the lower end. Connect all the points obtained to get a closed stair segment entity side frame line, and use this frame line to form a surface and push and pull one stair segment width to get the stair segment entity component. The modeling of the stair segment surface layer is simpler than the stair segment entity. You only need to generate two stair segment serrations and connect them. Different stair segment types require different stair segment components. Double-run stairs follow the above stair segment and stair segment surface layer parts; scissor stairs need to mirror flip a stair segment after generating it; PC stairs do not contain stair segment surface layers; steel stairs only contain stair segment surface layers; bicycle ramps require an additional ramp to be generated in the center of the stair segment.

[0067] (3.2.2) Generate the net height volume. Figure 3As shown in the clear height volume, A is formed by drawing a line segment a 2200 meters upwards from the first tread tip, and then drawing another line segment b 2200 meters upwards from the top tread tip. The parallelogram formed by line segments a\b is the cross-section of A, which is then pushed and pulled by the width of the stair segment to form block A. B is line segment a plus one tread height downwards, and then translated 300 meters toward the platform to form the cross-section of B, which is then pushed and pulled by the width of the stair segment to form block B. C is formed by directly translating line segment b 300 meters toward the platform to form the cross-section of C, and then pushed and pulled by the width of the stair segment to form block C. D is formed by extending one stair segment width toward the platform from the intersection of the first tread riser and the bottom platform surface, and then upwards 2000 meters to form the cross-section of D (excluding the overlapping part with B), and then pushed and pulled by the width of the stair segment to form block D. E starts at the intersection of the top step riser and the bottom landing, extending one stair-step width toward the landing. Then, 2000 meters up, it forms the cross-section of E (excluding the overlap with C). Then, it pushes and pulls along the stair-step width to form E. The volume of a 2.2m clear height stair is A+B+C+D+E.

[0068] (3.2.3) Generate the handrail. Starting from the intersection of the first step's structural riser and its building tread, draw upwards 90° (this is the default value for the handrail height parameter and is adjustable). Starting from the intersection of the structural riser and building tread of the top step, draw upwards 90°. Connect the endpoints of the two lines to create the cross-section handrail for this stair segment. Based on the cross-section generation logic, the handrail's path can be determined. Then, based on its relationship to the stair segment edge, the handrail offset and width can be assigned to create a 3D model of the handrail.

[0069] (3.2.4) Component Integration. Bind the above-obtained staircase components, such as the main body, clear height volume, and staircase handrail, into a group. This group is then "stacked" to the highest point of the currently generated staircase using a matrix transformation to obtain a complete and correct staircase component.

[0070] (3.3) During stair run generation, the system automatically adds text labels such as "front," "back," "left," and "right" to the model to identify the run's direction. These labels will dynamically adjust based on the run's direction. Furthermore, the generated run will be given a corresponding name for easier identification and operation.

[0071] Step 4: This step is a continuation of step 3. For the floor named "x~yF", all the stair sections of the xF layer have been generated in step 3. In order to generate all the floors, the stair sections of the xF layer need to be copied and moved, and the resulting floors need to be named. After generating all the stair sections of the modified floor, the construction parameters need to be updated to ensure that the floors generated later are in the correct direction and position.

[0072] Step 4 is an optional extension of Step 3. During modeling and debugging, it's generally not necessary to select the "Generate All Layers" option. This will only generate the xF model, speeding up the build process while preserving the inter-floor structure, making debugging easier. Once all debugging is complete, select this option to generate the complete model.

[0073] The fourth step includes the following sub-steps:

[0074] (4.1) After generating a staircase for a floor, if it detects that all floors need to be generated and the current floor is named x-y, the system copies it and applies it to the other floors. The number of floors, fnum = y-x+1, is calculated. Then, through a loop (from 2 to fnum), the transform! method is used to copy and translate the base floor along the Z axis by the height of the stairwell @tjg. The newly copied staircase is named "x+k-1" + "F", which is the current floor number plus "F" (the number of floors). This ensures that the generated staircase meets the architectural design requirements.

[0075] (4.2) After the stair sections for all floors under the parameters are generated, the algorithm adds the new stair sections to the model array and updates the offsets of some global variables to record the total height, offset and standard floor generation point of the stair section, ensuring that the generated stair sections are correctly connected with other parts of the overall model.

[0076] Step 5: Repeat steps 3 and 4, continuously extracting and generating floor data from the sorted floor name data, and packaging the generated results into a new group, so that a basic parametric stair model is obtained. After that, it is the finishing work after generation, including additional component generation, data preservation and scene restoration. The additional construction mainly includes "floor display" and "top extension platform". Data preservation refers to storing the parametrically generated parameters and the parameters of the UI panel directly in the final model to ensure that the model system can directly read and display the parameters of the current model later, and also provides support for transferring models between different users. After the model is generated correctly and stored, the scene needs to be restored. First, delete the old model, and then apply the transformation matrix of the old model to the new model to ensure that the model position is correct and restore the layer display of the scene.

[0077] Step 5 Repeat steps 3 and 4 and finish the parametric generation to generate the final model. Some of the generated stair models are as follows: Figure 4 、 Figure 5 shown.

[0078] The step five includes the following sub-steps:

[0079] (5.1) Repeat steps (3) and (4) to combine all stair segments and dimensions into a new group and add it to the current entity.

[0080] (5.2) If the floor display option is turned on, it means that a floor plan needs to be generated: Create a new group and add it to the current entity. At the same time, set the layer of this group to the "Floor Plan" layer and name it "Floor Plan". Take the floor models in step 5.1, calculate the minimum height, maximum and minimum boundaries of the entire stair combination, and add a 500mm buffer zone based on these boundaries to ensure that the floor plan covers the entire area. Create a plane for each floor height and add a text label with the floor name on the plane. Combine the generated stair group and floor plan group into a new group again.

[0081] (5.3) Perform exception capture. If an error occurs, restore the old staircase. Traverse all groups in the current model, find the old staircase group named stairname + "old", and restore its name to . This will prevent the loss of the old model due to improper operation.

[0082] (5.4) If no errors occur, perform the final configuration of the model. Combine all the resulting components into a new group, which is the final model group. Set its name to the stair segment name given by the user, and use the set_attribute method to store the offset and inverse transformation matrix of the stairs as custom attributes of the group. If the transformation matrix in step 2.2 exists, that is, the old model exists, the stair group is adjusted according to a specific transformation order: first apply the transformation matrix and then adjust the offset in the Z-axis direction. If it does not exist, only the offset in the Z-axis direction is adjusted. Store the relevant data of the stairs as custom attributes of the group.

[0083] (5.5) Iterate through all groups in the model again, find the old stair group named stairname+"old", clear its contents, and restore the visibility status of each layer.

[0084] The specific embodiments described herein are merely illustrative of the present invention. Persons skilled in the art may make various modifications, additions, or substitutions to the described specific embodiments without departing from the spirit of the present invention or exceeding the scope of the appended claims.

[0085] Although this document frequently uses terms such as staircase and clear height, it does not exclude the possibility of using other terms. These terms are used only to more conveniently describe and explain the essence of the present invention; interpreting them as any additional limitations is contrary to the spirit of the present invention.

Claims

1. A parametric staircase generation method based on SketchUp, characterized in that: The following steps are involved: (1) Open the parametric panel, edit and design the stair segment parameters, click Apply, and use JavaScript to package the data into a specific JSON format and pass it to the parametric stair segment generation algorithm written in the SketchUp Ruby API; (2) After obtaining the designed JSON parameters, the global stair parameters and the specific parameters of the stair sections based on the floor can be obtained from them. The parametric generation class of the stair sections is initialized according to the global stair parameters to mark the components to be generated, and the old model and view information in SketchUp are recorded at the same time; the specific parameter data of the stair sections are sorted from low to high according to the floor, the parameters are recorded and the relevant parameters for filling the connected stair section platforms and determining the location of the generated stair sections are initialized; (3) Take the lowest floor data that has not been generated from the specific parameters of the stair segment, read its universal stair parameters, and obtain the number of stair segments on the current floor; traverse the num stair segment parameters in the current floor, update the specific parameters of the current stair segment each time, and call different stair segment parameterization generation algorithms for different stair segment types, add the generated stair segment to the generation result list, and at the same time generate and fill the connected stair segment platform according to the generation result of the previous stair segment, and add it to the generation result list; and merge the list into a stair segment group for subsequent processing; (4) Select "Generate all floors" to view the floor names, where the floor names are x~yF. Copy the stair group generated in step (3) upwards yx times and name them according to the floor names. (5) Repeat steps (3) and (4) until all floors are generated; Generate the floor plan and top extension platform and merge them into one group to get the overall model containing all models. If there is an old model, move the overall model to the old position to finally complete the generation of the parametric stair section.

2. The method for generating parametric stair steps based on SketchUp according to claim 1, characterized in that: The step (1) is achieved through the following sub-steps: (1.1) Click the parametric generation panel icon to pop up the parametric staircase UI panel; (1.2) Check whether there is a selected model in SketchUp. If there is a selected model and the model is a stair segment generated based on SketchUp's parametric stair segment, the parametric generation data stored in the model is read and passed to the parametric panel constructed by HTML / CSS and JavaScript. JavaScript is used to read the parameters and display them. If no model is selected or no data is read, the parametric panel will be the default parameters. (1.3) After editing the parameters, click the Apply button. The parameters in the panel will be converted into specific JSON format data and transmitted to the parametric stair generation algorithm written in the SketchUp Ruby API.

3. The method for generating parametric stair steps based on SketchUp according to claim 1, characterized in that: The step (2) is implemented by the following sub-steps: (2.1) After obtaining the JSON data in step (1), initialize the stair segment parametric generation class object and read the stair segment global generation parameters, including whether to generate the evacuation radius volume, whether to generate all floors, whether to have a top extension platform, and whether to need floor display; (2.2) Traverse the existing models in SketchUp to find out whether there is a ladder with the same name. If so, record the transformation matrix of the model; if not, set the transformation matrix to the unit matrix; and record the current layer status in SketchUp to restore the layer display and hiding in SketchUp after the subsequent generation is completed; (2.3) Identify the floor names in the data and sort the parameter data by the floor names in descending order to form an order similar to [B3~B2F, B1F, 1F, 2~5F, RF]; (2.4) Maintain a standard point for model generation. After the stair segment model is generated at the origin, the model can be placed in the correct position by transforming it with reference to this standard point. The model is updated according to the stair segment parameters each time a stair segment is produced. At the same time, the data structure used to record the width, length, height and platform length of the previous stair segment is initialized to generate a connection component.

4. The method for generating parametric stair steps based on SketchUp according to claim 1, wherein: The step (3) is implemented by the following sub-steps: (3.1) Take the lowest floor data that has not been generated and read its general stair parameters, including stair type, stair height, stair width, step height, step width, and total number of steps; (3.1) Get the number of stair sections num, that is, the floor is composed of num stair sections. If the stair section type of the floor is a scissor stair, then the floor is composed of 2*num stair sections. (3.2) Read the stair parameters in sequence according to the stair number, call different stair parameterization generation algorithms according to the stair type, and update the model generation standard points; normally, a stair group contains a staircase and surface layer, two platforms and surface layers, clear height volume and railings; if it is a double-run staircase, generate a zigzag wireframe on the side of the stair according to the number of steps, step width and step height, and then push and pull it into a stair according to the stair width; the stair surface layer and platform are produced in the same way; the positions of different components are derived from the given parameters; if it is a scissor staircase, it is necessary to apply a mirror matrix to the original stair group based on the double-run staircase, and obtain the stair group on the other side according to the stair width offset; (3.3) Whenever a staircase is generated, the missing platforms caused by the stairwell need to be filled; (3.4) Put the models generated in steps (3.2) and (3.3) into the generated result list in turn to form groups, and obtain the floor stair model of the first floor.

5. The method for generating parametric stair steps based on SketchUp according to claim 1, characterized in that: The step (4) is implemented by the following sub-steps: (4.1) Check whether the global parameter is set to "Generate all layers". If so, proceed to step (4.2); otherwise, end step (4). (4.2) Check whether the current floor name is in the format of "X~YF". If so, it means that the same parameters are applied to all floors from XF to YF. The floor stair model of the XF floor generated in step (3) needs to be copied upwards. (4.3) In order to obtain the floor stair model of X+iF, it is necessary to copy the floor stair model of the XF layer and offset it upward by the height of i stairwells to obtain the floor stair model of X+iF.

6. The method for generating parametric stair steps based on SketchUp according to claim 1, characterized in that: The step (5) is implemented by the following sub-steps: (5.1) Repeat steps (3) and (4) according to the number of floor names obtained to generate all models into groups; (5.2) Group all the models generated in step (5.1) to obtain the total ladder model; (5.3) If "Floor Display" is selected, a transparent plane will be constructed at the initial height of each floor to indicate the floor according to the number of initial floor height groups. If "Top Extended Platform" is selected, a symmetrical stair landing plate will be generated on the other side of the top platform. (5.4) Merge the total stair segment model in step (5.2) and the other models in step (5.3) to obtain the final stair segment model group; (5.5) Apply the transformation matrix obtained in step (2.2) to the final stair model, store the JSON data generated in step (1.3) in the model, and restore the view.

Citation Information

Patent Citations

  • Spatial hyperbolic steel structure main arch ladder stand modeling method

    CN111460555A

  • Escalator parametric modeling method based on BIM

    CN112966319A