API-контракт
00 / ownershipCONSUMES
Line[]
Line.role
Line.subrole?
Line.rigidity
Line.geometryType
Line.pathGeometry
Line.strokeWidthPx?
Line.opacity
Line.directed
OPTIONAL:
Compo2.09.AttachmentDescriptor
Compo2.12.ParallelGroupDescriptor
Compo2.13.LineGridRelation
Text.labelAnchors?
StylePreset.lineGraphics?
PROVIDES
LineGraphicDescriptor
TechnicalMarkDescriptor
MotifGroupDescriptor
GraphicCandidate[]
GraphicCorrectionRequest[]
line.graphic.functionFit
line.graphic.motifCoherence
line.graphic.markCompleteness
line.graphic.orientationConsistency
line.graphic.familyConsistency
line.graphic.localGraphicScore
line.graphic.confidence
DOES NOT OWN
path geometry // 2.01/2.04/2.05
visual weight // 2.06
length role-fit // 2.07
intersections // 2.10
shape contact // 2.11
grid fit // 2.13
color/tone/opacity // 2.16
rhythm/stroke pattern // 2.17
global hierarchy/balance
Role contract: 2.15 не вводит новые top-level
Line.role. Понятия dimension, tick, bracket, decorative_stroke живут в graphicKind/subrole.Типология
01 / graphicKind| graphicKind | Типичный role | Функция | Что проверяет 2.15 |
|---|---|---|---|
decorative_stroke | accent / texture | характер, ornament | style grammar, coherence |
rule | divider / accent | типографическая/секционная линия | function fit |
tick | annotation / axis | метка шкалы/оси | orientation, completeness |
crosshair | annotation / axis | локатор/центр | orthogonality, shared center |
bracket | annotation / frame | обозначение диапазона | end caps, span relation |
dimension | annotation | измерительный диапазон | extensions, terminals, label slot |
leader | annotation / connector | label → object | graphic completeness; semantic attachment consumes 2.09 |
corner_mark | frame / annotation | угловая/crop метка | corner grammar |
registration_mark | annotation / axis | reference mark | center alignment, primitive completeness |
Список расширяем через
graphicKind, не через новые роли. Так style layer может иметь десятки мотивов без разрушения общей role taxonomy.Мотив как граф
02 / primitive grammarPrimitive
GraphicPrimitive {
id,
lineId,
primitiveRole:
STEM|CAP|TICK|EXTENSION|
TERMINAL|CROSS_ARM|GUIDE|ORNAMENT,
ownerGraphicId
}
Relation
GraphicRelation {
a,b,
relation:
ATTACHED|SHARED_CENTER|
PARALLEL|PERPENDICULAR|
COLLINEAR|MIRRORED|OFFSET
}
Motif
MotifGroupDescriptor {
id,
graphicKind,
primitiveIds[],
relationGraph[],
anchorRefs[],
completeness,
coherence,
confidence
}
Если grammar требует
PARALLEL, измерение можно consume из 2.12; 2.15 владеет только функциональным требованием этой параллельности внутри мотива.Техническая графика
03 / functional completenessDimension-like
required:
main span line
terminal A
terminal B
optional:
extension A/B
label anchor
leader
markCompleteness =
presentRequired / requiredCount
Crosshair
centerDistance =
distance(centerA,centerB)
angleError =
abs(90° - acuteAngle(A,B))
sharedCenterFit
orthogonalFit
Bracket
required:
stem
capStart
capEnd
capAngleFit
capLengthSimilarity
spanCoverage
Functional priority: для technical marks обязательные primitives важнее декоративной вариативности. StylePreset может менять пропорции, но не уничтожать смысл знака.
Декоративный мотив
04 / style grammarMotif profile
DecorativeMotifProfile {
allowedGeometry,
countRange?,
angleFamilies?,
lengthClassMix?,
widthClassMix?,
allowedRelations[],
symmetryMode?,
randomnessBudget?
}
Restraint
2.15 reports:
motif coherence
role compatibility
primitive completeness
family consistency
DEFERRED:
hierarchy competition
clutter
density
visual weight
color attention
Сложность не является положительным критерием сама по себе. Single rule и сложный ornament сравниваются только с собственной заявленной grammar.
Согласованность серии
05 / family consistencyVocabulary
shared attributes:
graphicKind
cap style
terminal style
width class
corner treatment
orientation family
Variation envelope
deviation_i =
distanceToFamilyProfile(x_i)
familyConsistency =
1 - robustAggregate(deviations)
Spacing boundary
2.15 MAY EXPORT:
positions[]
raw gaps[]
motif order[]
MUST NOT OWN:
rhythmScore
progressionScore
syncopationScore
Local scoring
06 / function firstOWNS
line.graphic.functionFit
line.graphic.motifCoherence
line.graphic.markCompleteness
line.graphic.orientationConsistency
line.graphic.familyConsistency
line.graphic.localGraphicScore
line.graphic.confidence
DEFERRED
line.visualWeight // 2.06
line.grid.localGridFit // 2.13
line.colorContrast // 2.16
rhythmScore // 2.17
global hierarchy
global balance
global density/clutter
TECHNICAL:
localGraphicScore =
wF*functionFit
+ wC*markCompleteness
+ wO*orientationConsistency
+ wG*familyConsistency
DECORATIVE:
localGraphicScore =
wM*motifCoherence
+ wG*familyConsistency
+ wR*roleCompatibility
// weights = STYLE_PRESET / INITIAL_HEURISTIC
// future 2.20 uses composite-first.
Candidate generation
07 / repairADD MISSING
Добавить обязательный cap/tick/terminal.
ALIGN RELATION
Попросить geometry-owner исправить perpendicular/parallel relation.
NORMALIZE FAMILY
Привести серию знаков к одному profile.
SIMPLIFY
Удалить необязательный primitive, нарушающий выбранную grammar.
GraphicCorrectionRequest {
graphicId,
primitiveIds[],
reasonCode:
MISSING_REQUIRED_PRIMITIVE |
WRONG_PRIMITIVE_RELATION |
FAMILY_STYLE_OUTLIER |
FUNCTION_MISMATCH |
REDUNDANT_PRIMITIVE,
targetOwner:
"Compo2.01"|"Compo2.04"|"Compo2.05"|
"Compo2.06"|"Compo2.13"|"Compo2.16"|
"Compo2.17"|"GLOBAL_SOLVER",
requestedChange,
confidence
}
Визуальная лаборатория
08 / examplesDimension-like: span + два terminal + optional extensions + label slot.
Crosshair: shared center + orthogonal relation.
Bracket: stem + два caps.
Decorative series: 2.15 проверяет family profile; интервалы между мотивами отдаёт 2.17.
Leader: 2.15 — graphic grammar; semantic attachment — 2.09.
Детерминированные тесты
09 / regressionTEST 01
dimension
required=3
present=3
expected completeness=1
TEST 02
dimension
required=3
present=2
expected completeness=2/3
TEST 03
crosshair
angles=0°,90°
centers equal
expected orientation=1
TEST 04
graphicKind=dimension
expected role=annotation
MUST NOT create role=dimension
TEST 05
gaps=[20,20,40]
expected raw gaps exported
rhythmScore NOT owned
TEST 06
same motif
different colors
expected grammar unchanged
2.16 handles color
TEST 07
single decorative rule
allowed by profile
expected no complexity penalty
TEST 08
5 ticks width=2
1 tick width=9
expected family outlier
weight remains 2.06
TEST 09
change global balance
expected 2.15 metrics unchanged
DATA FOR LAYOUT ENGINE
10 / machine contract{
"module": "Compo 2.15",
"name": "decorative_and_technical_line_graphics",
"version": "1.0",
"scope": "LOCAL_LINE_GRAPHIC_GRAMMAR",
"consumes": [
"Compo2.00.Line[]",
"Compo2.00.Line.role",
"Compo2.00.Line.subrole?",
"Compo2.00.LinePathGeometry",
"Compo2.06.Line.strokeWidthPx?",
"Compo2.09.AttachmentDescriptor?",
"Compo2.12.ParallelGroupDescriptor?",
"Compo2.13.LineGridRelation?",
"Text.labelAnchors?",
"StylePreset.lineGraphics?"
],
"provides": [
"LineGraphicDescriptor",
"TechnicalMarkDescriptor",
"MotifGroupDescriptor",
"GraphicCandidate[]",
"GraphicCorrectionRequest[]"
],
"graphic_kinds": [
"decorative_stroke","rule","tick","crosshair","bracket",
"dimension","leader","corner_mark","registration_mark"
],
"owns_metrics": [
"line.graphic.functionFit",
"line.graphic.motifCoherence",
"line.graphic.markCompleteness",
"line.graphic.orientationConsistency",
"line.graphic.familyConsistency",
"line.graphic.localGraphicScore",
"line.graphic.confidence"
],
"metric_policy": {
"primary_vote": "line.graphic.localGraphicScore",
"components": "diagnostic_only_by_default",
"rhythm_metrics": "FORBIDDEN_TO_OWN",
"color_metrics": "FORBIDDEN_TO_OWN",
"technical_required_primitives": "MAY_BE_HARD_CONSTRAINT"
},
"hard_rules": [
"must_not_create_new_top_level_line_roles",
"graphic_kind_belongs_to_subrole_or_graphic_descriptor",
"technical_required_primitives_must_be_validated",
"path_geometry_must_remain_owned_by_geometry_modules",
"semantic_attachment_must_remain_owned_by_2.09",
"parallel_geometry_may_be_consumed_from_2.12_not_reimplemented",
"grid_fit_may_be_consumed_from_2.13_not_reimplemented",
"rhythm_and_stroke_pattern_scoring_must_be_deferred_to_2.17",
"color_tone_opacity_scoring_must_be_deferred_to_2.16"
],
"initial_heuristics": {
"perpendicular_tolerance_deg": {"value":3,"source":"INITIAL_HEURISTIC"},
"shared_center_tau_shortN": {"value":0.008,"source":"INITIAL_HEURISTIC"},
"family_outlier_robust_z": {"value":2.5,"source":"IMPLEMENTATION_HEURISTIC"}
},
"deferred_inputs": [
"Compo2.16.lineColorContrast",
"Compo2.17.rhythmScore",
"global.hierarchyScore",
"global.balanceScore",
"global.densityScore",
"global.clutterScore",
"global.eyeFlowScore"
],
"finality": "LOCAL_FUNCTION_STYLE_PROPOSAL_ONLY"
}