Skip to content

Build modification #411

@trevorsandy

Description

@trevorsandy

Subject

Build modification - Solution for 'Update the Buffer Exchange framework' #115

Environment

Version of LPub3D - 2.4.0
Operating system - All

Solution

A more extensive write-up is forthcoming. Until then, this description and the example model file below illustrates the new BuildMod meta commands.

The Build modifications feature is turned on in Project Globals Setup inserting the meta command 0 !LPUB BUILD_MOD_ENABLED GLOBAL TRUE. Of course this commad can be added in the LDraw Editor as well.

The 3DViewer menu items tooltip should be straigntforward in describing what each menu does. Build Modifications is designed to allow the user to basically add, remove, move, rotate, and edit color of a STEP's parts in the 3DViewer (enabling the design focus of simplicity and user experience), or LDraw Editor (for optimal efficiency in large models) as desired - this is a moficication which will be enclosed in 0 !LPUB BUILD_MOD BEGIN <description> and 0 !LPUB BUILD_MOD END_MOD commands. The original parts follow and the entire modification block is terminated by 0 !LPUB BUILD_MOD END.

Once defined, the modification is automaticaly 'applied' to the STEP in which it was defined. The specified Build Mod can now be 'removed', and 'applied' in subsequent steps and across submodels with commands 0 !LPUB BUILD_MOD REMOVE "<description>" and 0 !LPUB BUILD_MOD APPLY "<description>" respectively. These are essentially the core command for Build Modifications. Remaining commands. Additional menu items serve to maintain existing Build Modification allowing the user to add, remove and edit modification blocks and their content etc...

When you create a modification block, that block is automatically interpreted by the meta command parser as being in the APPLY state for the STEP in which it is created. Taking the example below, we can see that in step 1, 3795.dat - 2 x 6 plate is in a raised position and is accompanied by helper part HasvL2.dat - Helper - Arrow Straight Vertical L2 indicating the direction of its placement.

0 !LPUB BUILD_MOD REMOVE <description> - The 'REMOVE' meta command instructs the parser to ignore the modified section of build modification and consequently, restore step's original content - i.e. the original content section of the build modification located between commands 0 !LPUB BUILD_MOD END_MOD and 0 !LPUB BUILD_MOD END. This command is expected in any step after the step in which the modification was created.

0 !LPUB BUILD_MOD APPLY <description> - The 'APPLY' meta command does the exact reverse of 'REMOVE'. This is to say it 'applies' the build modification - as you can see in step 6 in the example above. Subsequently, the modification is once again removed in the first step of right wing submodel - submodel_wing_r.ldr.

0 FILE 6967 - mini arc fighter - basic.ldr
0 6967 - mini arc fighter - basic.ldr
0 Name: 6967 - mini arc fighter - basic.ldr
0 Author: LPub3D [foodoo]
0 !LPUB BUILD_MOD_ENABLED GLOBAL TRUE
0 !LPUB PAGE BACKGROUND GLOBAL COLOR "#d5d8e3"
0 !LPUB BUILD_MOD BEGIN "6967 - mini arc fighter - basic.ldr Mod 1"
1 15 0 -64 0 0 0 -1 0 1 0 1 0 0 3795.DAT
1 7 20 8 0 0 0 -1 0 1 0 1 0 0 HasvL2.dat
0 !LPUB BUILD_MOD END_MOD
1 15 0 0 0 0 0 -1 0 1 0 1 0 0 3795.DAT
0 !LPUB BUILD_MOD END
1 15 20 8 0 0 0 -1 0 1 0 1 0 0 3022.DAT
1 15 -20 8 0 0 0 -1 0 1 0 1 0 0 3022.DAT
1 7 -30 0 -10 1 0 0 0 1 0 0 0 1 4081B.DAT
0 STEP
0 !LPUB MULTI_STEP BEGIN
1 7 30 0 -10 1 0 0 0 1 0 0 0 1 4081B.DAT
1 7 30 0 10 -1 0 0 0 1 0 0 0 -1 4081B.DAT
0 STEP
0 !LPUB BUILD_MOD REMOVE "6967 - mini arc fighter - basic.ldr mod 1"
1 7 -30 0 10 -1 0 0 0 1 0 0 0 -1 4081B.DAT
1 15 0 -8 0 0 0 -1 0 1 0 1 0 0 3022.DAT
0 STEP
1 15 -30 -8 0 0 0 -1 0 1 0 1 0 0 3794A.DAT
0 STEP
0 !LPUB MULTI_STEP END
1 15 30 -8 0 0 0 -1 0 1 0 1 0 0 3794A.DAT
1 320 -58 2 -30 0 1 0 0 0 1 1 0 0 3062B.DAT
1 320 -58 2 30 0 1 0 0 0 1 1 0 0 3062B.DAT
1 7 0 -16 10 -1 0 0 0 1 0 0 0 -1 2540.DAT
0 STEP
0 !LPUB BUILD_MOD APPLY "6967 - mini arc fighter - basic.ldr mod 1"
1 7 0 -16 -10 1 0 0 0 1 0 0 0 1 2540.DAT
1 15 60 -16 0 1 0 0 0 1 0 0 0 1 3710.DAT
1 320 -80 -16 0 1 0 0 0 1 0 0 0 1 3666.DAT
1 15 -130 -8 0 0 0 -1 0 1 0 1 0 0 3665A.DAT
1 15 50 -8 0 0 0 -1 0 1 0 1 0 0 3665A.DAT
0 STEP
0 !LPUB ASSEM CAMERA_ANGLES LOCAL 40.0000 65.0000
0 !LPUB ASSEM MODEL_SCALE LOCAL  2.0000
0 !LPUB INSERT PAGE
0 !LPUB INSERT DISPLAY_MODEL
0 STEP
1 15 50 -8 0 0 0 -1 0 1 0 1 0 0 3665A.DAT
0 STEP
1 15 -50 -8 0 0 0 1 0 1 0 -1 0 0 3665A.DAT
1 15 -10 -24 0 0 0 -1 0 1 0 1 0 0 3794A.DAT
1 15 10 -24 0 0 0 -1 0 1 0 1 0 0 3794A.DAT
1 8 40 -24 0 -1 0 0 0 1 0 0 0 -1 3023.DAT
1 8 -40 -24 0 -1 0 0 0 1 0 0 0 -1 3023.DAT
0 STEP
1 16 -37 8 99 1 0 0 0 1 0 0 0 1 Submodel_Wing_R.ldr
0 STEP
1 16 -37 8 -99 1 0 0 0 1 0 0 0 1 Submodel_Wing_L.ldr
0 STEP
1 15 -100 -24 0 -1 0 0 0 1 0 0 0 -1 2431.DAT
1 7 0 16 -10 1 0 0 0 1 0 0 0 1 2540.DAT
1 7 0 16 10 -1 0 0 0 1 0 0 0 -1 2540.DAT
1 15 20 18 30 0 -1 0 0.92388 0 0.382683 -0.382683 0 0.92388 44676.DAT
1 15 20 18 -30 0 -1 0 -0.92388 0 0.382683 -0.382683 0 -0.92388 44676.DAT
0 STEP
1 8 20 -32 0 -1 0 0 0 1 0 0 0 -1 3023.DAT
1 40 -20 -32 0 -1 0 0 0 1 0 0 0 -1 3023.DAT
0 STEP
0 !LPUB PLI BORDER LOCAL SQUARE 1 #999999 0.0312498 MARGINS 0.0499996 0.0499996
1 15 20 -14 30 0 -1 0 0.923879 0 -0.382683 0.382683 0 0.923879 44676.DAT
1 15 20 -14 -30 0 -1 0 -0.923879 0 -0.382683 0.382683 0 -0.923879 44676.DAT
0 STEP
1 15 50 -32 0 0 0 1 0 1 0 -1 0 0 4592.DAT
1 0 50 -32 0 0 -0.923879 0.382683 0 0.382683 0.923879 -1 0 0 4593.DAT
0 NOFILE 
0 FILE submodel_wing_r.ldr
0 Name: submodel_wing_r.ldr
0 Author: LPub3D [foodoo]
0 !LPUB BUILD_MOD REMOVE "6967 - mini arc fighter - basic.ldr mod 1"
1 15 37 -16 -19 -1 0 0 0 1 0 0 0 -1 41769.DAT
1 15 27 -8 1 0 0 1 0 1 0 -1 0 0 3710.DAT
0 STEP
1 320 27 -16 31 -1 0 0 0 1 0 0 0 -1 4081B.DAT
0 STEP
1 8 23 -14 51 0 -1 0 0 0 -1 1 0 0 30374.DAT
0 NOFILE 
0 FILE submodel_wing_l.ldr
0 Name: submodel_wing_l.ldr
0 Author: LPub3D [foodoo]
1 15 37 -16 19 1 0 0 0 1 0 0 0 1 41770.DAT
1 15 27 -8 -1 0 0 1 0 1 0 -1 0 0 3710.DAT
0 STEP
1 320 27 -16 -31 1 0 0 0 1 0 0 0 1 4081B.DAT
0 STEP
1 8 23 -14 -51 0 -1 0 0 0 -1 1 0 0 30374.DAT
0 NOFILE

Cheers,

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions