2011-01-07 16:25:15 +01:00
|
|
|
-- Symbol name
|
2011-02-09 14:18:22 +01:00
|
|
|
local names =
|
2011-01-07 16:25:15 +01:00
|
|
|
{
|
|
|
|
en = "OR",
|
2011-03-04 17:47:04 +01:00
|
|
|
cs = "OR",
|
2011-03-06 21:34:21 +01:00
|
|
|
sk = "OR",
|
2011-03-07 06:11:44 +01:00
|
|
|
pl = "OR",
|
|
|
|
de = "ODER"
|
2011-01-07 16:25:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
-- Render area in base units (X1, Y1, X2, Y2)
|
2011-02-09 14:18:22 +01:00
|
|
|
local area = {-4, -2, 5, 2}
|
2011-01-07 16:25:15 +01:00
|
|
|
|
2011-02-11 18:37:00 +01:00
|
|
|
-- Terminal points
|
2011-02-09 14:18:22 +01:00
|
|
|
local terminals = {{-4, -1}, {-4, 1}, {5, 0}}
|
2011-01-07 16:25:15 +01:00
|
|
|
|
|
|
|
-- Rendering
|
2011-02-09 14:18:22 +01:00
|
|
|
local render = function (cr)
|
2011-01-07 16:25:15 +01:00
|
|
|
-- The main shape
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:move_to (-2, -2)
|
|
|
|
cr:line_to (0, -2)
|
|
|
|
cr:curve_to (2, -2, 3, 0, 3, 0)
|
|
|
|
cr:curve_to (3, 0, 2, 2, 0, 2)
|
|
|
|
cr:line_to (-2, 2)
|
|
|
|
cr:curve_to (-1, 1, -1, -1, -2, -2)
|
2021-11-02 10:35:20 +01:00
|
|
|
cr:close_path ()
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:stroke ()
|
2011-01-07 16:25:15 +01:00
|
|
|
|
2011-02-11 18:37:00 +01:00
|
|
|
-- The terminals
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:save ()
|
2011-01-07 16:25:15 +01:00
|
|
|
|
|
|
|
-- Crop the contacts according to
|
|
|
|
-- the left side of the main shape
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:move_to (-4, 2)
|
|
|
|
cr:line_to (-2, 2)
|
|
|
|
cr:curve_to (-1, 1, -1, -1, -2, -2)
|
|
|
|
cr:line_to (-4, -2)
|
|
|
|
cr:close_path ()
|
|
|
|
cr:clip ()
|
2011-01-07 16:25:15 +01:00
|
|
|
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:move_to (-4, -1)
|
|
|
|
cr:line_to (-1, -1)
|
2011-01-07 16:25:15 +01:00
|
|
|
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:move_to (-4, 1)
|
|
|
|
cr:line_to (-1, 1)
|
2011-01-07 16:25:15 +01:00
|
|
|
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:stroke ()
|
|
|
|
cr:restore ()
|
2011-01-07 16:25:15 +01:00
|
|
|
|
2012-08-12 06:10:27 +02:00
|
|
|
cr:move_to (3, 0)
|
|
|
|
cr:line_to (5, 0)
|
|
|
|
cr:stroke ()
|
2011-01-07 16:25:15 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
-- Register the symbol
|
|
|
|
logdiag.register ("OR", names, area, terminals, render)
|
|
|
|
|
|
|
|
|