Categories
Cloud Software Techniques

Decorative Panels using Variables in Onshape

Recently, I noticed some decorative wood panelling and thought it would be an interesting exercise to create them, or something similar, as a 3D model using Onshape. The technique I’m going to use could be equally applied when creating fretwork or trellis.

DecorativeWoodPanel

I’ll take advantage of the symmetry in the design to simplify the geometry that I need to create and use the recently introduced “Variables” feature in Onshape as parameters to control the overall size and allow different designs to be easily created.

My design consists primarily of intersecting circular arcs which will be extruded to create a flat panel. A basic shape will be created and use the “Linear Pattern” feature to create the panel. Due to the symmetry in the basic shape, I only need to create a quarter which can then be mirrored to produce the basic shape.

Use the Variable command from the toolbar

VariableCommand

to create variables for:

Diameter – the overall size of the basic shape, initially set to 100mm.

VariableCreation

and

Thickness – the thickness of lines used in the shape, set to 2mm.

VariableFeatures

Note:
Variables are created as features and referenced by #name, in this case #Diameter and #Thickness. The value entered for the variable can use expressions, such as #Radius = #Diameter/2 but it remains unclear how extensive these can be (experiment for yourself).

Create a sketch, I’ve used the “Top” plane and will use the top right quadrant (origin at bottom left) to define the geometry.

Create horizontal and vertical construction lines and dimension their distance from the origin specifying the variable #Dimension as the value for the dimension. The dimension will be displayed showing the value of the variable.

Dimension

Note:
Dimensions defined using variables will be displayed showing the result of the expression. Click on the dimension to view/modify the value of the variable.

Proceed to create the remain geometry. Adding dimensions as necessary to ensure that the sketch is fully constrained.

dimension2

Dimension3

Dimension4

Extrude the sketch to create a solid

Quarter

Mirror the part to create half the shape.

half

Mirror the part to create the basic shape ready for patterning

Full

For the panel create 2 additional variables

#Horizontal – the number of basic shapes to pattern in the “x”-direction set to 2.

#Vertical – the number of basics shape to pattern in the “y”-direction set to 2.

and use the Linear Pattern tool to create the final pattern.

Vertical

Change the panel by sinply modifying the variables to create different results

FinalPanel

Modify the sketch to create more complex patterns

Sample2Outline

Sample2

Here’s the finished Panel matching (or at least close to) the original image

Complete

Summary

Variables are a useful addition to the functionality available in Onshape and could have been implemented to form the basis for a future fully featured macro programming language which may be made available for users. They can be used to simplify the process for non CAD literate users when modifications are required to the model.