1.0.24 • Published 1 year ago

geometric-props v1.0.24

Weekly downloads
-
License
Creative Common C...
Repository
github
Last release
1 year ago

Note: The units provided in the table are valid when entering the coordinates of the polygonal figure in centimeters (cm).

Geometric PropertieAcronymUnit
Section areaAcm²
Static moment with respect to the x-axisSxcm³
Static moment with respect to the y-axisSycm³
Moment of inertia with respect to the x-axisIxcm⁴
Moment of inertia with respect to the y-axisIycm⁴
Product of inertia with respect to the x and y axesIxycm⁴
Centroid of the section relative to the x-axisxgcm
Centroid of the section relative to the y-axisygcm
Barycentric moment of inertia (with respect to the centroid) on the x-axisIxgcm⁴
Barycentric moment of inertia (with respect to the centroid) on the y-axisIygcm⁴
Vertical distance between the center of gravity and the lowest point along the vertical axisY1cm
Vertical distance between the highest point along the vertical axis and the center of gravityY2cm
Resistant modulus, calculated considering Y1W1cm³
Resistant modulus, calculated considering Y2W2cm³
Heightheightcm
InformationAcronymUnit
Maximum coordinate with respect to the x axisxmaxcm
Minimum coordinate with respect to the x axisxmincm
Maximum coordinate with respect to the y axisymaxcm
Minimum coordinate with respect to the x axisymincm

Install the library:

npm install geometric-props

Import the class:

import { GeometricProps } from "geometric-props"

In the following case, we want to represent a rectangular figure with a base of 20cm and a height of 60cm, where the lower left corner is located at coordinates (0,0). The following table and figure represent the situation in question:

PointCoordinate on x axisCoordinate on y axis
100
2200
32060
4060
500
const rectangulo = new GeometricProps(
    [
        {'x':0, 'y':0},           //point 1
        {'x':20, 'y':0},          //point 2
        {'x':20, 'y':60},         //point 3
        {'x':0, 'y':60},          //point 4
        {'x':0, 'y':0}            //point 5
    ])
console.log(`
Xmax: ${rectangulo.Xmax.toFixed(2)} cm,
Xmin: ${rectangulo.Xmin.toFixed(2)} cm,
Ymax: ${rectangulo.Ymax.toFixed(2)} cm,
Ymin: ${rectangulo.Ymin.toFixed(2)} cm,
A: ${rectangulo.A.toFixed(2)} cm²,
Sx: ${rectangulo.Sx.toFixed(2)} cm³,
Sy: ${rectangulo.Sy.toFixed(2)} cm³,
Ix: ${rectangulo.Ix.toFixed(2)} cm⁴,
Iy: ${rectangulo.Iy.toFixed(2)} cm⁴,
Ixy: ${rectangulo.Ixy.toFixed(2)} cm⁴,
Xg: ${rectangulo.Xg.toFixed(2)} cm,
Yg: ${rectangulo.Yg.toFixed(2)} cm,
Ixg: ${rectangulo.Ixg.toFixed(2)} cm⁴,
Iyg: ${rectangulo.Iyg.toFixed(2)} cm⁴,
Ixyg: ${rectangulo.Ixyg.toFixed(2)} cm⁴,
Y1: ${rectangulo.Y1.toFixed(2)} cm,
Y2: ${rectangulo.Y2.toFixed(2)} cm,
W1: ${rectangulo.W1.toFixed(2)} cm³,
W2: ${rectangulo.W2.toFixed(2)} cm³,
height: ${rectangulo.height.toFixed(2)} cm,
base: ${rectangulo.base.toFixed(2)} cm,
`)

In the context of organizing modules in our project, we adopted the practice of "barrel export". This approach consists of creating a central file (the "barrel") that re-exports modules from multiple files, facilitating import and improving code clarity. Through "barrel export", we can simplify imports by grouping them into a single entry point. This not only makes the code cleaner and more manageable, but also makes maintenance and refactoring easier since changes to modules can be tracked from a single location.

The first step in install the project with npm:

npm install geometric-props

The second step is to import the module into your preferred file:

import { GeometricProps } from "geometric-props"

The third step is to instantiate the class, inserting the coordinates of the vertices, for more examples besides those demonstrated in the introduction, access the complete documentation on github, to access, click here

A partir dessa seção, será apresentada a documentação do projeto em português (pt-br).

Observação: As unidades disponibilizadas na tabela são válidas quando se insere as coordenadas da figura poligonal em centímetros (cm).

Propriedades GeométricasSiglaUnidade
Área da seçãoAcm²
Momento estático com relação ao eixo xSxcm³
Momento estático com relação ao eixo ySycm³
Momento de inércia com relação ao eixo xIxcm⁴
Momento de inércia com relação ao eixo yIycm⁴
Produto da inércia em relação aos eixos x e yIxycm⁴
Centróide da seção em relação ao eixo xxgcm
Centróide da seção em relação ao eixo yygcm
Momento de inércia baricêntrica (com relação ao centróide) no eixo xIxgcm⁴
Momento de inércia baricêntrica (com relação ao centróide) no eixo xIxgcm⁴
Distância vertical entre o centro de gravidade e o ponto mais baixo ao longo do eixo verticalY1cm
Distância vertical entre o ponto mais alto ao longo do eixo vertical e o centro de gravidadeY2cm
Módulo resistente, calculado considerando Y1W1cm³
Módulo resistente, calculado considerando Y2W2cm³
Alturaheightcm
InformaçãoSiglaUnidade
Coordenada máxima com relação ao eixo xxmaxcm
Coordenada mínima com relação ao eixo xxmincm
Coordenada máxima com relação ao eixo yymaxcm
Coordenada mínima com relação ao eixo yymincm

Instale a biblitoeca:

npm install geometric-props

Importe a classe:

import { GeometricProps } from "geometric-props"

No caso a seguir, queremos representar uma figura retangular com base de 20cm e altura de 60cm, em que a quina inferior esquerda está situada nas coordenadas (0,0). A tabela e a figura a seguir, representam a situação em questão:

PontoCoordenada no eixo xCoordenada no eixo y
100
2200
32060
4060
500
const rectangulo = new GeometricProps(
    [
        {'x':0, 'y':0},           //ponto 1
        {'x':20, 'y':0},          //ponto 2
        {'x':20, 'y':60},         //ponto 3
        {'x':0, 'y':60},          //ponto 4
        {'x':0, 'y':0}            //ponto 5
    ])
console.log(`
Xmax: ${rectangulo.Xmax.toFixed(2)} cm,
Xmin: ${rectangulo.Xmin.toFixed(2)} cm,
Ymax: ${rectangulo.Ymax.toFixed(2)} cm,
Ymin: ${rectangulo.Ymin.toFixed(2)} cm,
A: ${rectangulo.A.toFixed(2)} cm²,
Sx: ${rectangulo.Sx.toFixed(2)} cm³,
Sy: ${rectangulo.Sy.toFixed(2)} cm³,
Ix: ${rectangulo.Ix.toFixed(2)} cm⁴,
Iy: ${rectangulo.Iy.toFixed(2)} cm⁴,
Ixy: ${rectangulo.Ixy.toFixed(2)} cm⁴,
Xg: ${rectangulo.Xg.toFixed(2)} cm,
Yg: ${rectangulo.Yg.toFixed(2)} cm,
Ixg: ${rectangulo.Ixg.toFixed(2)} cm⁴,
Iyg: ${rectangulo.Iyg.toFixed(2)} cm⁴,
Ixyg: ${rectangulo.Ixyg.toFixed(2)} cm⁴,
Y1: ${rectangulo.Y1.toFixed(2)} cm,
Y2: ${rectangulo.Y2.toFixed(2)} cm,
W1: ${rectangulo.W1.toFixed(2)} cm³,
W2: ${rectangulo.W2.toFixed(2)} cm³,
height: ${rectangulo.height.toFixed(2)} cm,
base: ${rectangulo.base.toFixed(2)} cm,
`)

No contexto da organização dos módulos do nosso projeto, adotamos a prática de barrel export. Esta abordagem consiste na criação de um arquivo central (o “barril”) que reexporta módulos de múltiplos arquivos, facilitando a importação e melhorando a clareza do código. Através da “exportação em barril”, podemos simplificar as importações agrupando-as num único ponto de entrada. Isso não apenas torna o código mais limpo e gerenciável, mas também facilita a manutenção e a refatoração, já que as alterações nos módulos podem ser rastreadas em um único local.

O primeiro passo é fazer a instalação do projeto via npm:

npm install geometric-props

O segundo passo é fazer a importação do módulo no seu arquivo de preferência:

import { GeometricProps } from "geometric-props"

O terceiro passo é instanciar a classe, inserindo as coordenada dos vértices, para mais exemplos além dos demonstrados na introdução, acesse a documentação completa pelo github, para acessar, clique aqui

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago