ADG Lua 

ADG Lua Commit Details

Date:2013-03-18 21:55:31 (6 years 5 months ago)
Author:Nicola Fontana
Branch:master
Commit:b865851a2a8daafbe91055884acc1b4a4c0df5e0
Parents: a9846a05458b398e829cd9c7dc0504cef186c6eb
Message:Moved title block code on its own

Created a dedicated function to set the title code: a lot of data will
be shared between different views, so no need to duplicate it.
Changes:
Mpiston.lua (2 diffs)

File differences

piston.lua
270270
271271
272272
273
274
275
276
277
278
279
280
281
282
283
284
285
273286
274287
275288
......
405418
406419
407420
408
409
410
411
412
413
414
415
416
417
418
419
421
420422
423
421424
422425
423426
end
end)
local function add_title_block(canvas, title)
canvas:set_title_block(Adg.TitleBlock {
title = title or 'Generic title',
author = 'adg-demo',
date = os.date('%d/%m/%Y'),
drawing = 'PISTON',
logo = Adg.Logo {},
projection = Adg.Projection { scheme = Adg.ProjectionScheme.FIRST_ANGLE },
scale = '---',
size = 'A4',
})
end
local function add_dimensions(canvas, model)
local body = model.body
local hole = model.hole
end
function view.detailed(model)
local canvas = Adg.Canvas {
title_block = Adg.TitleBlock {
title = 'Detailed view',
author = 'adg-demo.lua',
date = os.date('%d/%m/%Y'),
drawing = '',
logo = Adg.Logo {},
projection = Adg.Projection { scheme = Adg.ProjectionScheme.FIRST_ANGLE },
scale = '---',
size = 'A4',
},
}
local canvas = Adg.Canvas {}
add_title_block(canvas, 'Detailed view')
canvas:add(Adg.Stroke { trail = model.body })
canvas:add(Adg.Stroke { trail = model.edges })
canvas:add(Adg.Hatch { trail = model.hole })

Archive Download the corresponding diff file

Branches

Tags