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,375 @@
|
|
|
1
|
+
# Casa Moderna - Terreno 20m x 60m
|
|
2
|
+
# Diseño optimizado con zonificación clara
|
|
3
|
+
# Orientación: Norte arriba (Y+), Sur abajo (Y=0)
|
|
4
|
+
# El frente de la casa da al sur (calle)
|
|
5
|
+
|
|
6
|
+
units m
|
|
7
|
+
|
|
8
|
+
defaults {
|
|
9
|
+
door_width 0.9
|
|
10
|
+
window_width 1.5
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
plan "Casa Moderna" {
|
|
14
|
+
# Footprint rectangular - 18m ancho x 28m profundidad
|
|
15
|
+
# Deja retiros laterales (1m cada lado) y jardín posterior
|
|
16
|
+
footprint rect (1, 1) (19, 29)
|
|
17
|
+
|
|
18
|
+
# ============================================
|
|
19
|
+
# ZONA DE ACCESO - Frente Sur (Y = 1 a 7)
|
|
20
|
+
# ============================================
|
|
21
|
+
|
|
22
|
+
# Cochera para 2 vehículos (6m x 6m)
|
|
23
|
+
room garage {
|
|
24
|
+
rect (1, 1) (7, 7)
|
|
25
|
+
label "Cochera"
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
# Hall de entrada principal
|
|
29
|
+
room foyer {
|
|
30
|
+
rect (7, 1) (11, 7)
|
|
31
|
+
label "Hall de Entrada"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
# Toilette de visitas (junto al foyer)
|
|
35
|
+
room toilette {
|
|
36
|
+
rect (11, 1) (14, 4)
|
|
37
|
+
label "Toilette"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# Lavadero
|
|
41
|
+
room laundry {
|
|
42
|
+
rect (14, 1) (19, 4)
|
|
43
|
+
label "Lavadero"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# ============================================
|
|
47
|
+
# ZONA SOCIAL - Centro (Y = 7 a 17)
|
|
48
|
+
# ============================================
|
|
49
|
+
|
|
50
|
+
# Hall distribuidor central
|
|
51
|
+
room hall_main {
|
|
52
|
+
rect (7, 7) (11, 12)
|
|
53
|
+
label "Hall"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# Oficina / Estudio (lado oeste, con privacidad)
|
|
57
|
+
room office {
|
|
58
|
+
rect (1, 7) (7, 12)
|
|
59
|
+
label "Oficina"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
# Living amplio (lado este)
|
|
63
|
+
room living {
|
|
64
|
+
rect (11, 4) (19, 12)
|
|
65
|
+
label "Living"
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# Cocina amplia
|
|
69
|
+
room kitchen {
|
|
70
|
+
rect (1, 12) (8, 17)
|
|
71
|
+
label "Cocina"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
# Comedor conectado con living y cocina
|
|
75
|
+
room dining {
|
|
76
|
+
rect (8, 12) (19, 17)
|
|
77
|
+
label "Comedor"
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
# ============================================
|
|
81
|
+
# ZONA PRIVADA - Fondo Norte (Y = 17 a 29)
|
|
82
|
+
# ============================================
|
|
83
|
+
|
|
84
|
+
# Pasillo de distribución a dormitorios
|
|
85
|
+
room hall_bedrooms {
|
|
86
|
+
rect (7, 17) (11, 24)
|
|
87
|
+
label "Pasillo"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
# Dormitorio 2 (lado oeste)
|
|
91
|
+
room bedroom2 {
|
|
92
|
+
rect (1, 17) (7, 22)
|
|
93
|
+
label "Dormitorio 2"
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
# Dormitorio 3 (lado oeste, fondo)
|
|
97
|
+
room bedroom3 {
|
|
98
|
+
rect (1, 22) (7, 29)
|
|
99
|
+
label "Dormitorio 3"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Baño compartido (entre dormitorios 2/3 y pasillo)
|
|
103
|
+
room bath_shared {
|
|
104
|
+
rect (7, 24) (11, 29)
|
|
105
|
+
label "Baño"
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
# ============================================
|
|
109
|
+
# SUITE PRINCIPAL - Esquina NE
|
|
110
|
+
# ============================================
|
|
111
|
+
|
|
112
|
+
# Master Bedroom (área principal)
|
|
113
|
+
room master {
|
|
114
|
+
rect (11, 17) (19, 24)
|
|
115
|
+
label "Suite Principal"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# Vestidor walk-in
|
|
119
|
+
room walkin {
|
|
120
|
+
rect (11, 24) (15, 29)
|
|
121
|
+
label "Vestidor"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
# Baño en suite
|
|
125
|
+
room bath_master {
|
|
126
|
+
rect (15, 24) (19, 29)
|
|
127
|
+
label "Baño Suite"
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# ============================================
|
|
131
|
+
# PUERTAS
|
|
132
|
+
# ============================================
|
|
133
|
+
|
|
134
|
+
# Puerta principal de entrada
|
|
135
|
+
opening door d_entrada {
|
|
136
|
+
on foyer.edge south
|
|
137
|
+
at 50%
|
|
138
|
+
width 1.2
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
# Garage a hall (puerta interior)
|
|
142
|
+
opening door d_garage_foyer {
|
|
143
|
+
between garage and foyer
|
|
144
|
+
on shared_edge
|
|
145
|
+
at 50%
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
# Foyer a toilette
|
|
149
|
+
opening door d_toilette {
|
|
150
|
+
between foyer and toilette
|
|
151
|
+
on shared_edge
|
|
152
|
+
at 50%
|
|
153
|
+
width 0.8
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
# Foyer a hall principal
|
|
157
|
+
opening door d_foyer_hall {
|
|
158
|
+
between foyer and hall_main
|
|
159
|
+
on shared_edge
|
|
160
|
+
at 50%
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
# Hall principal a oficina
|
|
164
|
+
opening door d_office {
|
|
165
|
+
between hall_main and office
|
|
166
|
+
on shared_edge
|
|
167
|
+
at 50%
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
# Hall principal a living
|
|
171
|
+
opening door d_living {
|
|
172
|
+
between hall_main and living
|
|
173
|
+
on shared_edge
|
|
174
|
+
at 50%
|
|
175
|
+
width 1.5
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
# Living a comedor (apertura amplia)
|
|
179
|
+
opening door d_living_dining {
|
|
180
|
+
between living and dining
|
|
181
|
+
on shared_edge
|
|
182
|
+
at 50%
|
|
183
|
+
width 2.4
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
# Hall a cocina
|
|
187
|
+
opening door d_hall_kitchen {
|
|
188
|
+
between hall_main and kitchen
|
|
189
|
+
on shared_edge
|
|
190
|
+
at 50%
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
# Cocina a comedor
|
|
194
|
+
opening door d_kitchen_dining {
|
|
195
|
+
between kitchen and dining
|
|
196
|
+
on shared_edge
|
|
197
|
+
at 50%
|
|
198
|
+
width 1.2
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
# Cocina a hall dormitorios
|
|
202
|
+
opening door d_kitchen_hall {
|
|
203
|
+
between kitchen and hall_bedrooms
|
|
204
|
+
on shared_edge
|
|
205
|
+
at 50%
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
# Hall dormitorios a dormitorio 2
|
|
209
|
+
opening door d_bed2 {
|
|
210
|
+
between hall_bedrooms and bedroom2
|
|
211
|
+
on shared_edge
|
|
212
|
+
at 50%
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
# Hall dormitorios a baño compartido
|
|
216
|
+
opening door d_bath {
|
|
217
|
+
between hall_bedrooms and bath_shared
|
|
218
|
+
on shared_edge
|
|
219
|
+
at 50%
|
|
220
|
+
width 0.8
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
# Hall dormitorios a master
|
|
224
|
+
opening door d_master {
|
|
225
|
+
between hall_bedrooms and master
|
|
226
|
+
on shared_edge
|
|
227
|
+
at 50%
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
# Master a vestidor
|
|
231
|
+
opening door d_walkin {
|
|
232
|
+
between master and walkin
|
|
233
|
+
on shared_edge
|
|
234
|
+
at 50%
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
# Vestidor a baño suite
|
|
238
|
+
opening door d_bath_master {
|
|
239
|
+
between walkin and bath_master
|
|
240
|
+
on shared_edge
|
|
241
|
+
at 50%
|
|
242
|
+
width 0.8
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
# Dormitorio 2 a dormitorio 3 (puerta interna opcional)
|
|
246
|
+
opening door d_bed2_bed3 {
|
|
247
|
+
between bedroom2 and bedroom3
|
|
248
|
+
on shared_edge
|
|
249
|
+
at 50%
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
# ============================================
|
|
253
|
+
# PUERTAS EXTERIORES
|
|
254
|
+
# ============================================
|
|
255
|
+
|
|
256
|
+
# Portón garage
|
|
257
|
+
opening door d_garage_ext {
|
|
258
|
+
on garage.edge south
|
|
259
|
+
at 50%
|
|
260
|
+
width 5.0
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
# Puerta lavadero al exterior
|
|
264
|
+
opening door d_laundry_ext {
|
|
265
|
+
on laundry.edge east
|
|
266
|
+
at 50%
|
|
267
|
+
width 0.9
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
# ============================================
|
|
271
|
+
# VENTANAS
|
|
272
|
+
# ============================================
|
|
273
|
+
|
|
274
|
+
# Oficina - ventana oeste
|
|
275
|
+
opening window w_office {
|
|
276
|
+
on office.edge west
|
|
277
|
+
at 2.5
|
|
278
|
+
width 2.0
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
# Living - ventanales este (hacia jardín lateral)
|
|
282
|
+
opening window w_living_e1 {
|
|
283
|
+
on living.edge east
|
|
284
|
+
at 2.5
|
|
285
|
+
width 2.5
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
opening window w_living_e2 {
|
|
289
|
+
on living.edge east
|
|
290
|
+
at 6.0
|
|
291
|
+
width 2.0
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
# Cocina - ventana oeste
|
|
295
|
+
opening window w_kitchen {
|
|
296
|
+
on kitchen.edge west
|
|
297
|
+
at 2.5
|
|
298
|
+
width 1.8
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
# Comedor - ventanal este
|
|
302
|
+
opening window w_dining {
|
|
303
|
+
on dining.edge east
|
|
304
|
+
at 2.5
|
|
305
|
+
width 3.0
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
# Dormitorio 2 - ventana oeste
|
|
309
|
+
opening window w_bed2 {
|
|
310
|
+
on bedroom2.edge west
|
|
311
|
+
at 2.5
|
|
312
|
+
width 1.8
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
# Dormitorio 3 - ventanas
|
|
316
|
+
opening window w_bed3_w {
|
|
317
|
+
on bedroom3.edge west
|
|
318
|
+
at 3.5
|
|
319
|
+
width 1.8
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
opening window w_bed3_n {
|
|
323
|
+
on bedroom3.edge north
|
|
324
|
+
at 3.0
|
|
325
|
+
width 1.5
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
# Baño compartido - ventana norte
|
|
329
|
+
opening window w_bath {
|
|
330
|
+
on bath_shared.edge north
|
|
331
|
+
at 2.0
|
|
332
|
+
width 1.0
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
# Master - ventanales
|
|
336
|
+
opening window w_master_e {
|
|
337
|
+
on master.edge east
|
|
338
|
+
at 4.0
|
|
339
|
+
width 2.5
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
# Baño master - ventana
|
|
343
|
+
opening window w_bath_master {
|
|
344
|
+
on bath_master.edge north
|
|
345
|
+
at 2.0
|
|
346
|
+
width 1.0
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
opening window w_bath_master_e {
|
|
350
|
+
on bath_master.edge east
|
|
351
|
+
at 2.5
|
|
352
|
+
width 1.2
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
# Vestidor - ventana
|
|
356
|
+
opening window w_walkin {
|
|
357
|
+
on walkin.edge north
|
|
358
|
+
at 2.0
|
|
359
|
+
width 1.2
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
# ============================================
|
|
363
|
+
# VALIDACIONES
|
|
364
|
+
# ============================================
|
|
365
|
+
|
|
366
|
+
assert no_overlap rooms
|
|
367
|
+
assert inside footprint all_rooms
|
|
368
|
+
assert min_room_area master >= 20
|
|
369
|
+
assert min_room_area living >= 30
|
|
370
|
+
assert min_room_area bedroom2 >= 12
|
|
371
|
+
assert min_room_area bedroom3 >= 14
|
|
372
|
+
assert min_room_area office >= 12
|
|
373
|
+
assert min_room_area garage >= 30
|
|
374
|
+
assert min_room_area kitchen >= 20
|
|
375
|
+
}
|