Skip to content
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request template
about: Plantilla guia para la elaboración de features en este proyecto.
title: ''
labels: Feature request
assignees: ''

---

## Nombre de la función / modulo
Nombre a asignar a la función/ modulo a implementar

## Ruta de la función / modulo
Ruta desde el menu de la aplicación para llamar a la función o forma en la que se ejecutara esta función/modulo

## Material de apoyo
Código de apoyo, material de soporte o enlaces a la documentación sugerida.
45 changes: 45 additions & 0 deletions PROYECTO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
1 0 -30 0
2 0 -10 0
3 0 -10 20
4 0 0 20
5 0 0 0
6 0 3O 0
7 0 30 15
8 0 15 15
9 0 15 25
10 0 30 25
11 0 30 25
12 0 40 35
13 0 30 45
14 0 -30 45
15 0 -40 35
16 0 -30 35
17 -30 -30 0
18 -30 -10 0
19 -30 -10 20
20 -30 0 20
21 -30 0 0
22 -30 30 0
23 -30 30 15
24 -30 15 15
25 -30 15 25
26 -30 30 25
27 -30 30 35
28 -30 40 35
29 -30 30 45
30 -30 -30 45
31 -30 -40 35
32 -30 -30 35
Faces:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 21 32.
1 2 5 6 22 17.
13 14 30 29.
12 13 29 28.
15 14 30 31.
29 30 31 32 27 28.
13 14 15 16 11 12.
1 16 32 17.
15 16 32 31.
11 12 28 27.
6 7 10 11 27 22.
77 changes: 77 additions & 0 deletions dist/src/canvasLocal.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var CanvasLocal = /** @class */ (function () {
this.centerX = this.maxX / 2;
this.centerY = this.maxY / 2;
}
<<<<<<< HEAD
CanvasLocal.prototype.iX = function (x) { return Math.round(this.centerX + x); };
CanvasLocal.prototype.iY = function (y) { return Math.round(this.centerY - y); };
CanvasLocal.prototype.paint = function () {
Expand All @@ -19,3 +20,79 @@ var CanvasLocal = /** @class */ (function () {
return CanvasLocal;
}());
export { CanvasLocal };
=======
iX(x) { return Math.round(this.centerX + x / this.pixelSize); }
iY(y) { return Math.round(this.centerY - y / this.pixelSize); }
drawLine(x1, y1, x2, y2) {
this.graphics.beginPath();
this.graphics.moveTo(x1, y1);
this.graphics.lineTo(x2, y2);
this.graphics.closePath();
this.graphics.stroke();
}
paint() {
//this.graphics.arc(this.iX(0), this.iY(0), Math.abs(this.iX(4)-this.iX(0)), 0,2*Math.PI, false);
//this.graphics.stroke();
//this.graphics.fillText("Lienzo listo desde ts", this.iX(2), this.iY(3.7));
//debugger;
//this.drawLine(320, 40, 480, 400);
//this.drawLine(320, 40, 140, 400);
//this.drawLine(140, 400, 480, 400);
let lado = 100;
let side = 0.95 * lado;
let sideHalf = 0.5 * side;
let xCenter = 320;
let yCenter = 240;
let h = sideHalf * Math.sqrt(3);
let xA, yA, xB, yB, xC, yC, xA1, yA1, xB1, yB1, xC1, yC1, p, q;
q = 0.05;
p = 1 - q;
/*xA = xCenter - sideHalf;
yA = yCenter - 0.5 * h;
xB = xCenter + sideHalf;
yB = yA;
xC = xCenter;
yC = yCenter + 0.5 * h; */
for (let m = 0; m < 4; m++) {
for (let n = 0; n < 4; n++) {
xA = 100 + n * lado - sideHalf;
yA = 100 + m * lado - 0.5 * h;
xB = 100 + n * lado + sideHalf;
yB = yA;
xC = 100 + n * lado;
yC = 100 + m * lado + 0.5 * h;
for (let i = 0; i < 20; i++) {
this.drawLine(xA, yA, xB, yB);
this.drawLine(xB, yB, xC, yC);
this.drawLine(xC, yC, xA, yA);
xA1 = p * xA + q * xB;
yA1 = p * yA + q * yB;
xB1 = p * xB + q * xC;
yB1 = p * yB + q * yC;
xC1 = p * xC + q * xA;
yC1 = p * yC + q * yA;
xA = xA1;
xB = xB1;
xC = xC1;
yA = yA1;
yB = yB1;
yC = yC1;
}
}
}
/* for (let i = 0; i < 50; i++){
this.drawLine(xA, yA, xB, yB);
this.drawLine(xB, yB, xC, yC);
this.drawLine(xC, yC, xA, yA);
xA1 = p * xA + q * xB;
yA1 = p * yA + q * yB;
xB1 = p * xB + q * xC;
yB1 = p * yB + q * yC;
xC1 = p * xC + q * xA;
yC1 = p * yC + q * yA;
xA = xA1; xB = xB1; xC = xC1;
yA = yA1; yB = yB1; yC = yC1;
} */
}
}
>>>>>>> main
16 changes: 12 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,22 @@
<link rel="stylesheet" href="./style/index.css">
</head>
<body>




<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<div class="container-fluid">
<a class="navbar-brand" href="#">Graficación</a>


<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse navbar-collapse" id="navbarNavDropdown">

<ul class="navbar-nav">

<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Abrir</a>
</li>
Expand Down Expand Up @@ -63,14 +71,14 @@

<div class="card text-center">
<div class="card-header">
Featured
Canvas de vizualizaion
</div>
<div class="chart card-img-bottom">
<canvas id="circlechart" width="640" height="400"></canvas>
<canvas id="circlechart" width="640" height="480"></canvas>
</div>
<div class="card-body">
<h5 class="card-title">Special title treatment</h5>
<p class="card-text">With supporting text below as a natural lead-in to additional content.</p>
<p class="card-text">Está es el área de dibujo dosponible.</p>


</div>
Expand Down
45 changes: 45 additions & 0 deletions proyectoCASA.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
1 0 -30 0
2 0 -10 0
3 0 -10 20
4 0 0 20
5 0 0 0
6 0 3O 0
7 0 30 15
8 0 15 15
9 0 15 25
10 0 30 25
11 0 30 25
12 0 40 35
13 0 30 45
14 0 -30 45
15 0 -40 35
16 0 -30 35
17 -30 -30 0
18 -30 -10 0
19 -30 -10 20
20 -30 0 20
21 -30 0 0
22 -30 30 0
23 -30 30 15
24 -30 15 15
25 -30 15 25
26 -30 30 25
27 -30 30 35
28 -30 40 35
29 -30 30 45
30 -30 -30 45
31 -30 -40 35
32 -30 -30 35
Faces:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 21 32.
1 2 5 6 22 17.
13 14 30 29.
12 13 29 28.
15 14 30 31.
29 30 31 32 27 28.
13 14 15 16 11 12.
1 16 32 17.
15 16 32 31.
11 12 28 27.
6 7 10 11 27 22.
101 changes: 101 additions & 0 deletions src/canvasLocal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

export class CanvasLocal {
//atributos
protected graphics: CanvasRenderingContext2D;
protected rWidth:number;
protected rHeight:number;
protected maxX: number;
protected maxY: number;
protected pixelSize: number;
protected centerX: number;
protected centerY: number;


public constructor(g: CanvasRenderingContext2D, canvas: HTMLCanvasElement){
this.graphics = g;
this. rWidth = 10;
this.rHeight= 10;
this.maxX = canvas.width - 1
this.maxY = canvas.height - 1;
this.pixelSize = Math.max(this.rWidth / this.maxX, this.rHeight / this.maxY);
this.centerX = this.maxX / 2;
this.centerY = this.maxY / 2;
}

iX( x: number):number{return Math.round(this.centerX + x/this.pixelSize);}
iY(y: number): number{ return Math.round(this.centerY - y / this.pixelSize); }
drawLine(x1: number, y1: number, x2: number, y2:number) {
this.graphics.beginPath();
this.graphics.moveTo(x1, y1);
this.graphics.lineTo(x2, y2);
this.graphics.closePath();
this.graphics.stroke();
}

paint() {
//this.graphics.arc(this.iX(0), this.iY(0), Math.abs(this.iX(4)-this.iX(0)), 0,2*Math.PI, false);
//this.graphics.stroke();
//this.graphics.fillText("Lienzo listo desde ts", this.iX(2), this.iY(3.7));
//debugger;
//this.drawLine(320, 40, 480, 400);
//this.drawLine(320, 40, 140, 400);
//this.drawLine(140, 400, 480, 400);
let lado = 100;
let side = 0.95 * lado;
let sideHalf = 0.5 * side;
let xCenter = 320;
let yCenter = 240;

let h = sideHalf * Math.sqrt(3);
let xA, yA, xB, yB, xC, yC,
xA1, yA1, xB1, yB1, xC1, yC1, p, q;
q = 0.05;
p = 1 - q;
/*xA = xCenter - sideHalf;
yA = yCenter - 0.5 * h;
xB = xCenter + sideHalf;
yB = yA;
xC = xCenter;
yC = yCenter + 0.5 * h; */

for (let m = 0; m < 4; m++){
for (let n = 0; n < 4; n++){
xA = 100+n*lado - sideHalf;
yA = 100+m*lado - 0.5 * h;
xB = 100+n*lado+ sideHalf;
yB = yA;
xC = 100+n*lado;
yC = 100+m*lado + 0.5 * h;
for (let i = 0; i < 20; i++){
this.drawLine(xA, yA, xB, yB);
this.drawLine(xB, yB, xC, yC);
this.drawLine(xC, yC, xA, yA);
xA1 = p * xA + q * xB;
yA1 = p * yA + q * yB;
xB1 = p * xB + q * xC;
yB1 = p * yB + q * yC;
xC1 = p * xC + q * xA;
yC1 = p * yC + q * yA;
xA = xA1; xB = xB1; xC = xC1;
yA = yA1; yB = yB1; yC = yC1;
}
}
}

/* for (let i = 0; i < 50; i++){
this.drawLine(xA, yA, xB, yB);
this.drawLine(xB, yB, xC, yC);
this.drawLine(xC, yC, xA, yA);
xA1 = p * xA + q * xB;
yA1 = p * yA + q * yB;
xB1 = p * xB + q * xC;
yB1 = p * yB + q * yC;
xC1 = p * xC + q * xA;
yC1 = p * yC + q * yA;
xA = xA1; xB = xB1; xC = xC1;
yA = yA1; yB = yB1; yC = yC1;
} */

}

}
Empty file added style/proyecto.txt
Empty file.