planscript 1.0.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LANGUAGE_REFERENCE.md +754 -0
- package/README.md +98 -107
- package/dist/ast/types.d.ts +11 -1
- package/dist/ast/types.d.ts.map +1 -1
- package/dist/exporters/svg.d.ts.map +1 -1
- package/dist/exporters/svg.js +126 -1
- package/dist/exporters/svg.js.map +1 -1
- package/dist/geometry/index.d.ts.map +1 -1
- package/dist/geometry/index.js +70 -16
- package/dist/geometry/index.js.map +1 -1
- package/dist/parser/grammar.d.ts +11 -4
- package/dist/parser/grammar.d.ts.map +1 -1
- package/dist/parser/grammar.js +578 -170
- package/dist/parser/grammar.js.map +1 -1
- package/examples/casa_moderna.psc +375 -0
- package/examples/casa_moderna_v2.psc +406 -0
- package/examples/casa_moderna_v3.psc +375 -0
- package/examples/casa_moderna_v5.psc +397 -0
- package/examples/house2.psc +156 -0
- package/examples/house2.svg +103 -0
- package/examples/house3.svg +139 -0
- package/package.json +2 -1
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
# Casa Moderna - Terreno 20m x 60m
|
|
2
|
+
# v2: Circulación corregida
|
|
3
|
+
# Orientación: Norte arriba (Y+), Sur abajo (calle)
|
|
4
|
+
|
|
5
|
+
units m
|
|
6
|
+
|
|
7
|
+
defaults {
|
|
8
|
+
door_width 0.9
|
|
9
|
+
window_width 1.5
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
plan "Casa Moderna" {
|
|
13
|
+
footprint rect (1, 1) (19, 29)
|
|
14
|
+
|
|
15
|
+
# ============================================
|
|
16
|
+
# ZONA DE ACCESO - Frente Sur (Y = 1 a 7)
|
|
17
|
+
# ============================================
|
|
18
|
+
|
|
19
|
+
# Cochera para 2 vehículos (6m x 6m)
|
|
20
|
+
room garage {
|
|
21
|
+
rect (1, 1) (7, 7)
|
|
22
|
+
label "Cochera"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
# Hall de entrada principal - eje central de la casa
|
|
26
|
+
room foyer {
|
|
27
|
+
rect (7, 1) (12, 7)
|
|
28
|
+
label "Hall de Entrada"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# Toilette de visitas
|
|
32
|
+
room toilette {
|
|
33
|
+
rect (12, 1) (15, 4)
|
|
34
|
+
label "Toilette"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
# Lavadero con acceso exterior
|
|
38
|
+
room laundry {
|
|
39
|
+
rect (15, 1) (19, 4)
|
|
40
|
+
label "Lavadero"
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
# Oficina - accesible desde el foyer, privada
|
|
44
|
+
room office {
|
|
45
|
+
rect (12, 4) (19, 9)
|
|
46
|
+
label "Oficina"
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# ============================================
|
|
50
|
+
# CIRCULACIÓN CENTRAL - Eje de la casa
|
|
51
|
+
# ============================================
|
|
52
|
+
|
|
53
|
+
# Pasillo principal que conecta TODO
|
|
54
|
+
# Va desde el foyer hasta los dormitorios
|
|
55
|
+
room hallway {
|
|
56
|
+
rect (7, 7) (12, 22)
|
|
57
|
+
label "Pasillo"
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
# ============================================
|
|
61
|
+
# ZONA SOCIAL - Lado Oeste (Y = 7 a 17)
|
|
62
|
+
# ============================================
|
|
63
|
+
|
|
64
|
+
# Living amplio
|
|
65
|
+
room living {
|
|
66
|
+
rect (1, 7) (7, 14)
|
|
67
|
+
label "Living"
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
# Comedor
|
|
71
|
+
room dining {
|
|
72
|
+
rect (1, 14) (7, 19)
|
|
73
|
+
label "Comedor"
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Cocina - conecta con comedor
|
|
77
|
+
room kitchen {
|
|
78
|
+
rect (1, 19) (7, 25)
|
|
79
|
+
label "Cocina"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# ============================================
|
|
83
|
+
# ZONA PRIVADA - Lado Este (Y = 9 a 29)
|
|
84
|
+
# ============================================
|
|
85
|
+
|
|
86
|
+
# Dormitorio 2
|
|
87
|
+
room bedroom2 {
|
|
88
|
+
rect (12, 9) (19, 15)
|
|
89
|
+
label "Dormitorio 2"
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
# Baño compartido
|
|
93
|
+
room bath_shared {
|
|
94
|
+
rect (12, 15) (16, 19)
|
|
95
|
+
label "Baño"
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
# Dormitorio 3
|
|
99
|
+
room bedroom3 {
|
|
100
|
+
rect (16, 15) (19, 22)
|
|
101
|
+
label "Dormitorio 3"
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
# ============================================
|
|
105
|
+
# SUITE PRINCIPAL - Fondo Norte
|
|
106
|
+
# ============================================
|
|
107
|
+
|
|
108
|
+
# Master Bedroom
|
|
109
|
+
room master {
|
|
110
|
+
rect (12, 22) (19, 29)
|
|
111
|
+
label "Suite Principal"
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
# Vestidor dentro del master (esquina NO)
|
|
115
|
+
room walkin {
|
|
116
|
+
rect (12, 26) (15, 29)
|
|
117
|
+
label "Vestidor"
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
# Baño en suite (esquina NE)
|
|
121
|
+
room bath_master {
|
|
122
|
+
rect (15, 26) (19, 29)
|
|
123
|
+
label "Baño Suite"
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
# Despensa/almacén junto a cocina
|
|
127
|
+
room pantry {
|
|
128
|
+
rect (1, 25) (4, 29)
|
|
129
|
+
label "Despensa"
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
# Patio de servicio techado
|
|
133
|
+
room service_yard {
|
|
134
|
+
rect (4, 25) (7, 29)
|
|
135
|
+
label "Patio Servicio"
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# ============================================
|
|
139
|
+
# PUERTAS - CIRCULACIÓN PRINCIPAL
|
|
140
|
+
# ============================================
|
|
141
|
+
|
|
142
|
+
# Entrada principal
|
|
143
|
+
opening door d_entrada {
|
|
144
|
+
on foyer.edge south
|
|
145
|
+
at 50%
|
|
146
|
+
width 1.2
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
# Garage a foyer
|
|
150
|
+
opening door d_garage {
|
|
151
|
+
between garage and foyer
|
|
152
|
+
on shared_edge
|
|
153
|
+
at 50%
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
# Foyer a toilette
|
|
157
|
+
opening door d_toilette {
|
|
158
|
+
between foyer and toilette
|
|
159
|
+
on shared_edge
|
|
160
|
+
at 50%
|
|
161
|
+
width 0.8
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
# Foyer a oficina
|
|
165
|
+
opening door d_office {
|
|
166
|
+
between foyer and office
|
|
167
|
+
on shared_edge
|
|
168
|
+
at 50%
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
# Foyer a pasillo central (conexión principal)
|
|
172
|
+
opening door d_foyer_hall {
|
|
173
|
+
between foyer and hallway
|
|
174
|
+
on shared_edge
|
|
175
|
+
at 50%
|
|
176
|
+
width 1.2
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
# ============================================
|
|
180
|
+
# PUERTAS - ZONA SOCIAL (desde pasillo)
|
|
181
|
+
# ============================================
|
|
182
|
+
|
|
183
|
+
# Pasillo a living
|
|
184
|
+
opening door d_living {
|
|
185
|
+
between hallway and living
|
|
186
|
+
on shared_edge
|
|
187
|
+
at 30%
|
|
188
|
+
width 1.5
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
# Pasillo a comedor
|
|
192
|
+
opening door d_dining {
|
|
193
|
+
between hallway and dining
|
|
194
|
+
on shared_edge
|
|
195
|
+
at 50%
|
|
196
|
+
width 1.2
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
# Pasillo a cocina
|
|
200
|
+
opening door d_kitchen {
|
|
201
|
+
between hallway and kitchen
|
|
202
|
+
on shared_edge
|
|
203
|
+
at 50%
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
# Living a comedor (apertura amplia)
|
|
207
|
+
opening door d_living_dining {
|
|
208
|
+
between living and dining
|
|
209
|
+
on shared_edge
|
|
210
|
+
at 50%
|
|
211
|
+
width 2.0
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
# Comedor a cocina
|
|
215
|
+
opening door d_dining_kitchen {
|
|
216
|
+
between dining and kitchen
|
|
217
|
+
on shared_edge
|
|
218
|
+
at 50%
|
|
219
|
+
width 1.2
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
# Cocina a despensa
|
|
223
|
+
opening door d_pantry {
|
|
224
|
+
between kitchen and pantry
|
|
225
|
+
on shared_edge
|
|
226
|
+
at 50%
|
|
227
|
+
width 0.8
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
# Cocina a patio servicio
|
|
231
|
+
opening door d_service {
|
|
232
|
+
between kitchen and service_yard
|
|
233
|
+
on shared_edge
|
|
234
|
+
at 50%
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
# ============================================
|
|
238
|
+
# PUERTAS - ZONA PRIVADA (desde pasillo)
|
|
239
|
+
# ============================================
|
|
240
|
+
|
|
241
|
+
# Pasillo a dormitorio 2
|
|
242
|
+
opening door d_bed2 {
|
|
243
|
+
between hallway and bedroom2
|
|
244
|
+
on shared_edge
|
|
245
|
+
at 50%
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
# Pasillo a baño compartido
|
|
249
|
+
opening door d_bath {
|
|
250
|
+
between hallway and bath_shared
|
|
251
|
+
on shared_edge
|
|
252
|
+
at 50%
|
|
253
|
+
width 0.8
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
# Pasillo a dormitorio 3
|
|
257
|
+
opening door d_bed3 {
|
|
258
|
+
between hallway and bedroom3
|
|
259
|
+
on shared_edge
|
|
260
|
+
at 50%
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
# Pasillo a master
|
|
264
|
+
opening door d_master {
|
|
265
|
+
between hallway and master
|
|
266
|
+
on shared_edge
|
|
267
|
+
at 50%
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
# ============================================
|
|
271
|
+
# PUERTAS - SUITE MASTER
|
|
272
|
+
# ============================================
|
|
273
|
+
|
|
274
|
+
# Master a vestidor
|
|
275
|
+
opening door d_walkin {
|
|
276
|
+
between master and walkin
|
|
277
|
+
on shared_edge
|
|
278
|
+
at 50%
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
# Master a baño suite (acceso directo también)
|
|
282
|
+
opening door d_bath_master {
|
|
283
|
+
between master and bath_master
|
|
284
|
+
on shared_edge
|
|
285
|
+
at 50%
|
|
286
|
+
width 0.8
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
# ============================================
|
|
290
|
+
# PUERTAS EXTERIORES
|
|
291
|
+
# ============================================
|
|
292
|
+
|
|
293
|
+
# Portón garage
|
|
294
|
+
opening door d_garage_ext {
|
|
295
|
+
on garage.edge south
|
|
296
|
+
at 50%
|
|
297
|
+
width 5.0
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
# Lavadero al exterior
|
|
301
|
+
opening door d_laundry_ext {
|
|
302
|
+
on laundry.edge east
|
|
303
|
+
at 50%
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
# ============================================
|
|
307
|
+
# VENTANAS
|
|
308
|
+
# ============================================
|
|
309
|
+
|
|
310
|
+
# Living - ventanales oeste
|
|
311
|
+
opening window w_living_w {
|
|
312
|
+
on living.edge west
|
|
313
|
+
at 3.5
|
|
314
|
+
width 3.0
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
# Comedor - ventana oeste
|
|
318
|
+
opening window w_dining {
|
|
319
|
+
on dining.edge west
|
|
320
|
+
at 2.5
|
|
321
|
+
width 2.5
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
# Cocina - ventana oeste
|
|
325
|
+
opening window w_kitchen {
|
|
326
|
+
on kitchen.edge west
|
|
327
|
+
at 3.0
|
|
328
|
+
width 2.0
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
# Oficina - ventanas
|
|
332
|
+
opening window w_office_e {
|
|
333
|
+
on office.edge east
|
|
334
|
+
at 2.5
|
|
335
|
+
width 2.0
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
opening window w_office_s {
|
|
339
|
+
on office.edge south
|
|
340
|
+
at 1.5
|
|
341
|
+
width 1.5
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
# Dormitorio 2 - ventana este
|
|
345
|
+
opening window w_bed2 {
|
|
346
|
+
on bedroom2.edge east
|
|
347
|
+
at 3.0
|
|
348
|
+
width 2.0
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
# Dormitorio 3 - ventana este
|
|
352
|
+
opening window w_bed3 {
|
|
353
|
+
on bedroom3.edge east
|
|
354
|
+
at 3.5
|
|
355
|
+
width 1.8
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
# Baño compartido - ventana
|
|
359
|
+
opening window w_bath {
|
|
360
|
+
on bath_shared.edge east
|
|
361
|
+
at 2.0
|
|
362
|
+
width 1.0
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
# Master - ventanales este y norte
|
|
366
|
+
opening window w_master_e {
|
|
367
|
+
on master.edge east
|
|
368
|
+
at 3.5
|
|
369
|
+
width 2.5
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
# Baño suite - ventana
|
|
373
|
+
opening window w_bath_master {
|
|
374
|
+
on bath_master.edge east
|
|
375
|
+
at 2.0
|
|
376
|
+
width 1.0
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
# Vestidor - ventana norte
|
|
380
|
+
opening window w_walkin {
|
|
381
|
+
on walkin.edge north
|
|
382
|
+
at 1.5
|
|
383
|
+
width 1.0
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
# Despensa - ventana
|
|
387
|
+
opening window w_pantry {
|
|
388
|
+
on pantry.edge north
|
|
389
|
+
at 1.5
|
|
390
|
+
width 1.0
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
# ============================================
|
|
394
|
+
# VALIDACIONES
|
|
395
|
+
# ============================================
|
|
396
|
+
|
|
397
|
+
assert no_overlap rooms
|
|
398
|
+
assert inside footprint all_rooms
|
|
399
|
+
assert min_room_area master >= 20
|
|
400
|
+
assert min_room_area living >= 20
|
|
401
|
+
assert min_room_area bedroom2 >= 12
|
|
402
|
+
assert min_room_area bedroom3 >= 12
|
|
403
|
+
assert min_room_area office >= 15
|
|
404
|
+
assert min_room_area garage >= 30
|
|
405
|
+
assert min_room_area kitchen >= 20
|
|
406
|
+
}
|