示例:创建配置规则
注意
此卡车驾驶室颜色的配置规则创建示例基于数据库toy_truck_tuto.pd3。你可以在这里下载。
首先,需要为可配置元素创建方面图层。

在Matter中,通过单击界面底部的此图标打开方面图层窗口
。
选择按拾取材料分割工具。
单击链接到配置的元素以创建方面图层。
重命名按照命名原则创建的方面图层:“partition.value”(例如:Cabin.Blue)。
使用此命名系统可以自动创建配置规则(请参阅下一段)。使用它可以节省大量时间。
单击“复制方面图层”按钮以创建链接到配置的元素的变体。
在元素上拖放一个新材质,以便为方面图层分配链接到配置的元素所采用的新值。
根据新分配的值重命名方面图层(在我们的示例中:Cabin.Yellow)。
重复步骤5至7,根据需要创建多个变体。
通过重复步骤2到4创建新的可配置元素,然后通过重复步骤5到7创建它们的衍生物。
注意
Patchwork 3D 还可以让您创建与几何相关的产品衍生产品。



方面层Cabin.Yellow, Cabin.Red和Cabin.Blue.
点击此图标显示对话框配置。在浏览器选项卡中,从下拉列表中选择黄色。使用相同的前缀“Cabin.”命名所有图层,然后将图层选择拖放到配置编辑器的规则选项卡中。该界面构建了以下规则:
Cabin.Yellow (defined "Cabin.Yellow")
Cabin.Red (defined "Cabin.Red")
Cabin.Blue (defined "Cabin.Blue")

规则Cabin.Blue确定方面图层模式l / 产品 / Cabin.Blue的可见性。
该规则集遵循排除原则:一次只评估其中一个为真。这些新规则都针对一个方面层。
该规则集遵循排除原则:一次只评估其中一个为真。这些新规则都针对一个方面层。符号Cabin.Yellow,Cabin.Red和Cabin.Blue会自动添加为配置编辑器中可用符号的下拉列表。选择黄色意味着定义符号Cabin.Yellow。由于每次只能定义其中一个符号,因此只有一个新规则被评估为true。创建了与客舱颜色对应的分区。

从新规则中涉及的符号自动生成下拉列表。
在浏览器标签中,从下拉菜单中选择 黄色。在“ 检查 ”选项卡中,“Cabin.Yellow”规则的值为绿色,因此为绿色。然后可以看到方面层 Model / Product /Cabin.Yellow。Cabin.Red和Cabin.Blue规则显示为红色,因为它们是错误的。这些规则的目标层是隐藏的。

检查选项卡显示规则评估的结果。
创建一个配置规则,用于以相同的方式启用或禁用在地面上显示的材料。首先,创建对应地面上的材质分配的方面层模型/产品/地面。通过将图层从方面图层编辑器拖放到配置编辑器来生成规则“Ground”:弹出简单规则编辑器,允许指定规则名称和涉及的符号。

使用简单规则编辑器创建地面规则。
“地面”规则遵循激活/去激活原则,并写为:
Ground (defined "Ground")
创建与地面相对应的分区,且定义符号Ground的复选框会自动添加到对话框配置中浏览器选项卡中可用符号的列表中。选中复选框定义符号。

用于定义符号Ground的复选框。