Capannone mettallico in FreeCad

Forum per le domande e le discussioni in Italiano
Forum rules
regole del forum e le informazioni utili

Importante: PRIMA di chiedere aiuto leggete qui!
renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Wed Nov 22, 2017 9:20 pm

Per provare dei profili L e T con FreeCAD0.17.12619
file csv

Code: Select all

#Data structure:
#Category, Name, Profile class, geometric data...
#Possible profile classes are: 
#C=Circular tube
#H= H- or I-profile
#R= Rectangular
#RH= Rectangular hollow
#U= U-profile
#L= L-profile
#T= T-profile
###########################################
#Circular tube
#Category,Name,H,Outside diameter,Thickness
CTH,CTH423,C,42.4,3.2
#H- or I-profile
#Category,Name,H,width,height,web thickness,flange thickness
HEA,HEA100,H,100,96,5,8
HEA,HEA120,H,120,114,5,8
HEA,HEA140,H,140,133,5.5,8.5
HEA,HEA160,H,160,152,6,9
HEA,HEA180,H,180,171,6,9.5
HEA,HEA200,H,200,190,6.5,10
HEA,HEA220,H,220,210,7,11
HEA,HEA240,H,240,230,7.5,12
HEA,HEA260,H,260,250,7.5,12.5
HEA,HEA280,H,280,270,8,13
HEA,HEA300,H,300,290,8.5,14
HEA,HEA320,H,300,310,9,15.5
HEA,HEA340,H,300,330,9.5,16.5
HEA,HEA360,H,300,350,10,17.5
HEA,HEA400,H,300,390,11,19
HEA,HEA450,H,300,440,11.5,21
HEA,HEA500,H,300,490,12,23
HEA,HEA550,H,300,540,12.5,24
HEA,HEA600,H,300,590,13,25
HEA,HEA650,H,300,640,13.5,26
HEA,HEA700,H,300,690,14.5,27
HEA,HEA800,H,300,790,15,28
HEA,HEA900,H,300,890,16,30
HEA,HEA1000,H,300,990,16.5,31
HEA,HEAA100,H,100,91,4.2,5.5
HEA,HEAA120,H,120,109,4.2,5.5
HEA,HEAA140,H,140,128,4.3,6
HEA,HEAA160,H,160,148,4.5,7
HEA,HEAA180,H,180,167,5,7.5
HEA,HEAA200,H,200,186,5.5,8
HEA,HEAA220,H,220,205,6,8.5
HEA,HEAA240,H,240,224,6.5,9
HEA,HEAA260,H,260,244,6.5,9.5
HEA,HEAA280,H,280,264,7,10
HEA,HEAA300,H,300,283,7.5,10.5
HEA,HEAA320,H,300,301,8,11
HEA,HEAA340,H,300,320,8.5,11.5
HEA,HEAA360,H,300,339,9,12
HEA,HEAA400,H,300,378,9.5,13
HEA,HEAA450,H,300,425,10,13.5
HEA,HEAA500,H,300,472,10.5,14
HEA,HEAA550,H,300,522,11.5,15
HEA,HEAA600,H,300,571,12,15.5
HEA,HEAA650,H,300,620,12.5,16
HEA,HEAA700,H,300,670,13,17
HEA,HEAA800,H,300,770,14,18
HEA,HEAA900,H,300,870,15,20
HEA,HEAA1000,H,300,970,16,21
HEB,HEB100,H,100,100,6,10
HEB,HEB120,H,120,120,6.5,11
HEB,HEB140,H,140,140,7,12
HEB,HEB160,H,160,160,8,13
HEB,HEB180,H,180,180,8.5,14
HEB,HEB200,H,200,200,9,15
HEB,HEB220,H,220,220,9.5,16
HEB,HEB240,H,240,240,10,17
HEB,HEB260,H,260,260,10,17.5
HEB,HEB280,H,280,280,10.5,18
HEB,HEB300,H,300,300,11,19
HEB,HEB320,H,300,320,11.5,20.5
HEB,HEB340,H,300,340,12,21.5
HEB,HEB360,H,300,360,12.5,22.5
HEB,HEB400,H,300,400,13.5,24
HEB,HEB450,H,300,450,14,26
HEB,HEB500,H,300,500,14.5,28
HEB,HEB550,H,300,550,15,29
HEB,HEB600,H,300,600,15.5,30
HEB,HEB650,H,300,650,16,31
HEB,HEB700,H,300,700,17,32
HEB,HEB800,H,300,800,17.5,33
HEB,HEB900,H,300,900,18.5,35
HEB,HEB1000,H,300,1000,19,36
HEM,HEM160,H,166,180,14,23
HEM,HEM180,H,186,200,14.5,24
HEM,HEM200,H,206,220,15,25
HEM,HEM220,H,226,240,15.5,26
HEM,HEM240,H,248,270,18,32
HEM,HEM260,H,268,290,18,32.5
HEM,HEM280,H,288,310,18.5,33
HEM,HEM300,H,310,340,21,39
HEM,HEM320,H,309,359,21,40
HEM,HEM340,H,309,377,21,40
HEM,HEM360,H,308,395,21,40
HEM,HEM400,H,307,432,21,40
HEM,HEM450,H,307,478,21,40
HEM,HEM500,H,306,524,21,40
HEM,HEM550,H,306,572,21,40
HEM,HEM600,H,305,620,21,40
HEM,HEM650,H,305,668,21,40
HEM,HEM700,H,304,716,21,40
HEM,HEM800,H,303,814,21,40
HEM,HEM900,H,302,910,21,40
HEM,HEM1000,H,302,1008,21,40
INP,INP80,H,42,80,3.9,5.9
INP,INP100,H,50,100,4.5,6.8
INP,INP120,H,58,120,5.1,7.7
INP,INP140,H,66,140,5.7,8.6
INP,INP160,H,74,160,6.3,9.5
INP,INP180,H,82,180,6.9,10.4
INP,INP200,H,90,200,7.5,11.3
INP,INP220,H,98,220,8.1,12.2
INP,INP240,H,106,240,8.7,13.1
INP,INP260,H,113,260,9.4,14.1
INP,INP280,H,119,280,10.1,15.2
INP,INP300,H,125,300,10.8,16.2
INP,INP320,H,131,320,11.5,17.3
INP,INP340,H,137,340,12.2,18.3
INP,INP360,H,143,360,13,19.5
INP,INP380,H,149,380,13.7,20.5
INP,INP400,H,155,400,14.4,21.6
IPE,IPE100,H,55,100,4.1,5.7
IPE,IPE120,H,64,120,4.4,6.3
IPE,IPE140,H,73,140,4.7,6.9
IPE,IPE160,H,82,160,5,7.4
IPE,IPE180,H,91,180,5.3,8
IPE,IPE200,H,100,200,5.6,8.5
IPE,IPE220,H,110,220,5.9,9.2
IPE,IPE240,H,120,240,6.2,9.8
IPE,IPE270,H,135,270,6.6,10.2
IPE,IPE300,H,150,300,7.1,10.7
IPE,IPE330,H,160,330,7.5,11.5
IPE,IPE360,H,170,360,8,12.7
IPE,IPE400,H,180,400,8.6,13.5
IPE,IPE450,H,190,450,9.4,14.6
IPE,IPE500,H,200,500,10.2,16
IPE,IPE550,H,210,550,11.1,17.2
IPE,IPE600,H,220,600,12,19
IPE,IPEA100,H,55,98,3.6,4.7
IPE,IPEA120,H,64,118,3.8,5.1
IPE,IPEA140,H,73,138,3.8,5.6
IPE,IPEA160,H,82,157,4,5.9
IPE,IPEA180,H,91,177,4.3,6.5
IPE,IPEA200,H,100,197,4.5,7
IPE,IPEA220,H,110,217,5,7.7
IPE,IPEA240,H,120,237,5.2,8.3
IPE,IPEA270,H,135,267,5.5,8.7
IPE,IPEA300,H,150,297,6.1,9.2
IPE,IPEA330,H,160,327,6.5,10
IPE,IPEA360,H,170,357.6,6.6,11.5
IPE,IPEA400,H,180,397,7,12
IPE,IPEA450,H,190,447,7.6,13.1
IPE,IPEA500,H,200,497,8.4,14.5
IPE,IPEA550,H,210,547,9,15.7
IPE,IPEA600,H,220,597,9.8,17.5
IPE,IPEO180,H,89,182,6.4,9.5
IPE,IPEO200,H,102,202,6.2,9.5
IPE,IPEO220,H,112,222,6.6,10.2
IPE,IPEO240,H,122,242,7,10.8
IPE,IPEO270,H,136,274,7.5,12.2
IPE,IPEO300,H,152,304,8,12.7
IPE,IPEO330,H,162,334,8.5,13.5
IPE,IPEO360,H,172,364,9.2,14.7
IPE,IPEO400,H,182,404,9.7,15.5
IPE,IPEO450,H,192,456,11,17.6
IPE,IPEO500,H,202,506,12,19
IPE,IPEO550,H,212,556,12.7,20.2
IPE,IPEO600,H,224,610,15,24
IPE,IPER140,H,72,142,5.3,7.8
IPE,IPER160,H,81,162,5.6,8.5
IPE,IPER180,H,92,183,6,9
IPE,IPER200,H,98,204,6.6,10.5
IPE,IPER220,H,108,225,6.7,11.8
IPE,IPER240,H,118,245,7.5,12.3
IPE,IPER270,H,133,276,7.1,13.1
IPE,IPER300,H,147,306,8.5,13.7
IPE,IPER330,H,158,336,9.2,14.5
IPE,IPER360,H,168,366,9.9,16
IPE,IPER400,H,178,407,10.6,17
IPE,IPER450,H,188,458,11.3,18.6
IPE,IPER500,H,198,508,12.6,20
IPE,IPER550,H,210,560,14,22.2
IPE,IPER600,H,218,608,14,23
IPE,IPEV400,H,182,408,10.6,17.5
IPE,IPEV450,H,194,460,12.4,19.6
IPE,IPEV500,H,204,514,14.2,23
IPE,IPEV550,H,216,566,17.1,25.2
IPE,IPEV600,H,228,618,18,28
IPE,IPE750x137,H,263,753,11.5,17
IPE,IPE750x147,H,265,753,13.2,17
IPE,IPE750x161,H,266,758,13.8,19.3
IPE,IPE750x173,H,267,762,14.4,21.6
IPE,IPE750x185,H,267,766,14.9,23.6
IPE,IPE750x196,H,268,770,15.6,25.4
IPE,IPE750x210,H,268,775,16,28
IPE,IPE750x222,H,269,778,17,29.5
#Rectangular
#Category,Name,R,width,height
REC,1x2in,R,19,28
REC,1x3in,R,19,64
REC,1x4in,R,19,89
REC,1x6in,R,19,89
REC,1x8in,R,19,140
REC,1x10in,R,19,184
REC,1x12in,R,19,286
REC,2x2in,R,38,38
REC,2x3in,R,38,64
REC,2x4in,R,38,89
REC,2x6in,R,38,140
REC,2x8in,R,38,184
REC,2x10in,R,38,235
REC,2x12in,R,38,286
REC,4x4in,R,89,89
REC,4x6in,R,89,140
REC,6x6in,R,140,140
REC,8x8in,R,184,184
#RH-profile
#Category,Name,RH,width,height,thickness
RHS,RHS120x90x3,RH,120,80,3
RHS,RHS120x80x5,RH,120,80,5
RHS,RHS120x80x8,RH,120,80,8
RHS,RHS120x100x4,RH,120,100,4
RHS,RHS120x100x5,RH,120,100,5
RHS,RHS140x80x5,RH,140,80,5
RHS,RHS150x100x5,RH,150,100,5
RHS,RHS150x100x10,RH,150,100,10
RHS,RHS160x80x5,RH,160,80,5
RHS,RHS180x100x6,RH,180,100,6
RHS,RHS180x120x6,RH,180,120,6
RHS,RHS200x80x6,RH,200,80,6
RHS,RHS200x100x10,RH,200,100,10
#U-profile
#Category,Name,U,width,height,web thickness,flange thickness
UPE,UPE80,U,80,50,4,7
UPE,UPE100,U,100,55,4.5,7.5
UPE,UPE120,U,120,60,5,8
UPE,UPE140,U,140,65,5,9
UPE,UPE160,U,160,70,5.5,9.5
UPE,UPE180,U,180,75,5.5,10.5
UPE,UPE200,U,200,80,6,11
UPE,UPE220,U,220,85,6.5,12
UPE,UPE240,U,240,90,7,12.5
UPE,UPE270,U,270,95,7.5,13.5
UPE,UPE300,U,300,100,9.5,15
UPE,UPE330,U,330,105,11,16
UPE,UPE360,U,360,110,12,17
UPE,UPE400,U,400,115,13.5,18
#L-profile
#Category,Name,L,width,height,thickness
L,L25x15x3,L,25,15,3
L,L25x15x4,L,25,15,4
L,L25x15x5,L,25,15,5
L,L30x20x3,L,30,20,3
L,L30x20x4,L,30,20,4
L,L30x20x5,L,30,20,5
L,L40x20x4,L,40,20,4
L,L40x20x5,L,40,20,5
L,L45x30x4,L,45,30,4
L,L45x30x5,L,45,30,5
L,L45x30x6,L,45,30,6
L,L50x30x5,L,50,30,5
L,L50x30x6,L,50,30,6
L,L60x30x5,L,60,30,5
L,L60x30x6,L,60,30,6
L,L60x40x5,L,60,40,5
L,L60x40x6,L,60,40,6
L,L60x50x8,L,60,50,8
L,L80x40x6,L,80,40,6
L,L80x40x8,L,80,40,8
L,L100x50x10,L,100,50,10
L1,L10x2,L,10,10,2
L1,L12x2,L,12,12,2
L1,L12x3,L,12,12,3
L1,L15x2,L,15,15,2
L1,L15x3,L,15,15,3
L1,L15x4,L,15,15,4
L1,L20x2,L,20,20,2
L1,L20x3,L,20,20,3
L1,L20x4,L,20,20,4
L1,L20x5,L,20,20,5
#T-profile
#Category,Name,T,width,height,thickness
T,T15x3,T,15,15,3
T,T20x3,T,20,20,3
T,T20x4,T,20,20,4
T,T25x3.5,T,25,25,3.5
T,T25x4.5,T,25,25,4.5
T,T30x3,T,30,30,3
T,T30x4,T,30,30,4
T,T30x5,T,30,30,5
T,T35x3.5,T,35,35,3.5
T,T35x4,T,35,35,4
T,T35x4.5,T,35,35,4.5
T,T40x4,T,40,40,4
T,T40x5,T,40,40,5
T,T40x6,T,40,40,6
T,T50x6,T,50,50,6
T,T50x7,T,50,50,7
T,T60x7,T,60,60,7
T,T60x8,T,60,60,8
T,T70x8,T,70,70,8
T,T70x9,T,70,70,9
T,T80x9,T,80,80,9
T,T80x10,T,80,80,10
T,T100x11,T,100,100,11
T1,T30x4,T,30,30,4
T1,T35x4.5,T,35,35,4.5
T1,T40x5,T,40,40,5
T1,T50x6,T,50,50,6
T1,T60x7,T,60,60,7
T1,T70x8,T,70,70,8
T1,T80x9,T,80,80,9
renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Wed Nov 22, 2017 9:22 pm

file ArchProfile.py modificato

Code: Select all

#***************************************************************************
#*                                                                         *
#*   Copyright (c) 2011                                                    *
#*   Yorik van Havre <yorik@uncreated.net>                                 *
#*                                                                         *
#*   This program is free software; you can redistribute it and/or modify  *
#*   it under the terms of the GNU Lesser General Public License (LGPL)    *
#*   as published by the Free Software Foundation; either version 2 of     *
#*   the License, or (at your option) any later version.                   *
#*   for detail see the LICENCE text file.                                 *
#*                                                                         *
#*   This program is distributed in the hope that it will be useful,       *
#*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
#*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
#*   GNU Library General Public License for more details.                  *
#*                                                                         *
#*   You should have received a copy of the GNU Library General Public     *
#*   License along with this program; if not, write to the Free Software   *
#*   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  *
#*   USA                                                                   *
#*                                                                         *
#***************************************************************************

import FreeCAD, Draft, os
from FreeCAD import Vector
import csv

if FreeCAD.GuiUp:
    import FreeCADGui
    from PySide import QtCore, QtGui
    from DraftTools import translate
    from PySide.QtCore import QT_TRANSLATE_NOOP
else:
    # \cond
    def translate(ctxt,txt):
        return txt
    def QT_TRANSLATE_NOOP(ctxt,txt):
        return txt
    # \endcond

## @package ArchProfile
#  \ingroup ARCH
#  \brief Profile tools for ArchStructure
#
#  This module provides tools to build base profiles
#  for Arch Strucutre elements

__title__="FreeCAD Profile"
__author__ = "Yorik van Havre"
__url__ = "http://www.freecadweb.org"

# Presets in the form: Class, Name, Profile type, [profile data]
# Search for profiles.csv in data/Mod/Arch/Presets and in the same folder as this file
profilefiles = [os.path.join(FreeCAD.getResourceDir(),"Mod","Arch","Presets","profiles.csv"),
                os.path.join(os.path.dirname(__file__),"Presets","profiles.csv")]

def readPresets():
    Presets=[]
    for profilefile in profilefiles:
        if os.path.exists(profilefile):
            try:
                with open(profilefile, "r") as csvfile:
                    beamreader = csv.reader(csvfile)
                    bid=1 #Unique index
                    for row in beamreader:
                        if row[0].startswith("#"):
                            continue
                        try:
                            r=[bid, row[0], row[1], row[2]]
                            for i in range(3,len(row)):
                                r=r+[float(row[i])]
                            if not r in Presets:
                                Presets.append(r)
                            bid=bid+1
                        except ValueError:
                            print("Skipping bad line: "+str(row))
            except IOError:
                print("Could not open ",profilefile)
    return Presets

def makeProfile(profile=[0,'REC','REC100x100','R',100,100]):
    '''makeProfile(profile): returns a shape  with the face defined by the profile data'''
    obj = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython",profile[2])
    obj.Label = translate("Arch",profile[2])
    if profile[3]=="C":
        _ProfileC(obj, profile)
    elif profile[3]=="H":
        _ProfileH(obj, profile)
    elif profile[3]=="R":
        _ProfileR(obj, profile)
    elif profile[3]=="RH":
        _ProfileRH(obj, profile)
    elif profile[3]=="U":
        _ProfileU(obj, profile)
    elif profile[3]=="L":
        _ProfileL(obj, profile)
    elif profile[3]=="T":
        _ProfileT(obj, profile)
    else :
        print("Profile not supported")
    if FreeCAD.GuiUp:
        Draft._ViewProviderDraft(obj.ViewObject)
    return obj

class _Profile(Draft._DraftObject):
    '''Superclass for Profile classes'''

    def __init__(self,obj, profile):
        self.Profile=profile
        Draft._DraftObject.__init__(self,obj,"Profile")
        
            
class _ProfileC(_Profile):
    '''A parametric circular tubeprofile. Profile data: [Outside diameter, Inside diameter]'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","OutDiameter","Draft",QT_TRANSLATE_NOOP("App::Property","Outside Diameter")).OutDiameter = profile[4]
        obj.addProperty("App::PropertyLength","Thickness","Draft",QT_TRANSLATE_NOOP("App::Property","Wall thickness")).Thickness = profile[5]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        c1=Part.Circle()
        c1.Radius=obj.OutDiameter.Value
        c2=Part.Circle()
        c2.Radius=obj.OutDiameter.Value-2*obj.Thickness.Value
        cs1=c1.toShape()
        cs2=c2.toShape()
        p=Part.makeRuledSurface(cs2,cs1)
        obj.Shape = p
        obj.Placement = pl
        
class _ProfileH(_Profile):
    '''A parametric H or I beam profile. Profile data: [width, height, web thickness, flange thickness] (see http://en.wikipedia.org/wiki/I-beam for reference)'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4]
        obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5]
        obj.addProperty("App::PropertyLength","WebThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the web")).WebThickness = profile[6]
        obj.addProperty("App::PropertyLength","FlangeThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the flanges")).FlangeThickness = profile[7]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        p1 = Vector(-obj.Width.Value/2,-obj.Height.Value/2,0)
        p2 = Vector(obj.Width.Value/2,-obj.Height.Value/2,0)
        p3 = Vector(obj.Width.Value/2,(-obj.Height.Value/2)+obj.FlangeThickness.Value,0)
        p4 = Vector(obj.WebThickness.Value/2,(-obj.Height.Value/2)+obj.FlangeThickness.Value,0)
        p5 = Vector(obj.WebThickness.Value/2,obj.Height.Value/2-obj.FlangeThickness.Value,0)
        p6 = Vector(obj.Width.Value/2,obj.Height.Value/2-obj.FlangeThickness.Value,0)
        p7 = Vector(obj.Width.Value/2,obj.Height.Value/2,0)
        p8 = Vector(-obj.Width.Value/2,obj.Height.Value/2,0)
        p9 = Vector(-obj.Width.Value/2,obj.Height.Value/2-obj.FlangeThickness.Value,0)
        p10 = Vector(-obj.WebThickness.Value/2,obj.Height.Value/2-obj.FlangeThickness.Value,0)
        p11 = Vector(-obj.WebThickness.Value/2,(-obj.Height.Value/2)+obj.FlangeThickness.Value,0)
        p12 = Vector(-obj.Width.Value/2,(-obj.Height.Value/2)+obj.FlangeThickness.Value,0)
        p = Part.makePolygon([p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p1])
        p = Part.Face(p)
        #p.reverse()
        obj.Shape = p
        obj.Placement = pl

class _ProfileR(_Profile):
    '''A parametric rectangular beam profile based on [Width, Height]'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4]
        obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        p1 = Vector(-obj.Width.Value/2,-obj.Height.Value/2,0)
        p2 = Vector(obj.Width.Value/2,-obj.Height.Value/2,0)
        p3 = Vector(obj.Width.Value/2,obj.Height.Value/2,0)
        p4 = Vector(-obj.Width.Value/2,obj.Height.Value/2,0)
        p = Part.makePolygon([p1,p2,p3,p4,p1])
        p = Part.Face(p)
        #p.reverse()
        obj.Shape = p
        obj.Placement = pl

class _ProfileRH(_Profile):
    '''A parametric Rectangular hollow beam profile. Profile data: [width, height, thickness]'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4]
        obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5]
        obj.addProperty("App::PropertyLength","Thickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the sides")).Thickness = profile[6]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        p1 = Vector(-obj.Width.Value/2,-obj.Height.Value/2,0)
        p2 = Vector(obj.Width.Value/2,-obj.Height.Value/2,0)
        p3 = Vector(obj.Width.Value/2,obj.Height.Value/2,0)
        p4 = Vector(-obj.Width.Value/2,obj.Height.Value/2,0)
        q1 = Vector(-obj.Width.Value/2+obj.Thickness.Value,-obj.Height.Value/2+obj.Thickness.Value,0)
        q2 = Vector(obj.Width.Value/2-obj.Thickness.Value,-obj.Height.Value/2+obj.Thickness.Value,0)
        q3 = Vector(obj.Width.Value/2-obj.Thickness.Value,obj.Height.Value/2-obj.Thickness.Value,0)
        q4 = Vector(-obj.Width.Value/2+obj.Thickness.Value,obj.Height.Value/2-obj.Thickness.Value,0)
        p = Part.makePolygon([p1,p2,p3,p4,p1])
        q = Part.makePolygon([q1,q2,q3,q4,q1])
        r = Part.Face([p,q])
        #r.reverse()
        obj.Shape = r
        obj.Placement = pl
        
class _ProfileU(_Profile):
    '''A parametric H or I beam profile. Profile data: [width, height, web thickness, flange thickness] (see  http://en.wikipedia.org/wiki/I-beam forreference)'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4]
        obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5]
        obj.addProperty("App::PropertyLength","WebThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the webs")).WebThickness = profile[6]
        obj.addProperty("App::PropertyLength","FlangeThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the flange")).FlangeThickness = profile[7]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        p1 = Vector(-obj.Width.Value/2,-obj.Height.Value/2,0)
        p2 = Vector(obj.Width.Value/2,-obj.Height.Value/2,0)
        p3 = Vector(obj.Width.Value/2,obj.Height.Value/2,0)
        p4 = Vector(obj.Width.Value/2-obj.FlangeThickness.Value,obj.Height.Value/2,0)
        p5 = Vector(obj.Width.Value/2-obj.FlangeThickness.Value,obj.WebThickness.Value-obj.Height.Value/2,0)
        p6 = Vector(-obj.Width.Value/2+obj.FlangeThickness.Value,obj.WebThickness.Value-obj.Height.Value/2,0)
        p7 = Vector(-obj.Width.Value/2+obj.FlangeThickness.Value,obj.Height.Value/2,0)
        p8 = Vector(-obj.Width.Value/2,obj.Height.Value/2,0)
        p = Part.makePolygon([p1,p2,p3,p4,p5,p6,p7,p8,p1])
        p = Part.Face(p)
        #p.reverse()
        obj.Shape = p
        obj.Placement = pl

class _ProfileL(_Profile):
    '''A parametric L beam profile. Profile data: [width, height, web thickness]'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4]
        obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5]
        obj.addProperty("App::PropertyLength","WebThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the webs")).WebThickness = profile[6]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        p1 = Vector(-obj.Width.Value/2,-obj.Height.Value/2,0)
        p2 = Vector(obj.Width.Value/2,-obj.Height.Value/2,0)
        p3 = Vector(obj.Width.Value/2,obj.Height.Value/2,0)
        p4 = Vector(obj.Width.Value/2-obj.WebThickness.Value,obj.Height.Value/2,0)
        p5 = Vector(obj.Width.Value/2-obj.WebThickness.Value,obj.WebThickness.Value-obj.Height.Value/2,0)
        p6 = Vector(-obj.Width.Value/2,obj.WebThickness.Value-obj.Height.Value/2,0)        
        p = Part.makePolygon([p1,p2,p3,p4,p5,p6,p1])
        p = Part.Face(p)
        #p.reverse()
        obj.Shape = p
        obj.Placement = pl
		
class _ProfileT(_Profile):
    '''A parametric T beam profile. Profile data: [width, height, web thickness]'''

    def __init__(self,obj, profile):
        obj.addProperty("App::PropertyLength","Width","Draft",QT_TRANSLATE_NOOP("App::Property","Width of the beam")).Width = profile[4]
        obj.addProperty("App::PropertyLength","Height","Draft",QT_TRANSLATE_NOOP("App::Property","Height of the beam")).Height = profile[5]
        obj.addProperty("App::PropertyLength","WebThickness","Draft",QT_TRANSLATE_NOOP("App::Property","Thickness of the web")).WebThickness = profile[6]
        _Profile.__init__(self,obj,profile)

    def execute(self,obj):
        import Part
        pl = obj.Placement
        p1 = Vector(-obj.Width.Value/2,-obj.Height.Value/2,0)
        p2 = Vector(obj.Width.Value/2,-obj.Height.Value/2,0)
        p3 = Vector(obj.Width.Value/2,(-obj.Height.Value/2)+obj.WebThickness.Value,0)
        p4 = Vector(obj.WebThickness.Value/2,(-obj.Height.Value/2)+obj.WebThickness.Value,0)
        p5 = Vector(obj.WebThickness.Value/2,obj.Height.Value/2,0)
        p6 = Vector(-obj.WebThickness.Value/2,obj.Height.Value/2,0)
        p7 = Vector(-obj.WebThickness.Value/2,(-obj.Height.Value/2)+obj.WebThickness.Value,0)
        p8 = Vector(-obj.Width.Value/2,(-obj.Height.Value/2)+obj.WebThickness.Value,0)
        p = Part.makePolygon([p1,p2,p3,p4,p5,p6,p7,p8,p1])
        p = Part.Face(p)
        #p.reverse()
        obj.Shape = p
        obj.Placement = pl
        
        

renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Wed Nov 22, 2017 10:24 pm

Infine Flamingo distribuzione di travi a T
flamingo travi a T.png
flamingo travi a T.png (20.28 KiB) Viewed 693 times
File di esempio Section_T.csv da salvare in C:\Users\User\AppData\Roaming\FreeCAD\Mod\flamingo\tables

Code: Select all

SSize;stype;H;W;ta;tf
T15;T;15;15;3;3
T20;T;20;20;3;3
Renato
Alex68
Posts: 43
Joined: Wed Jul 06, 2016 3:08 pm

Re: Capannone mettallico in FreeCad

Postby Alex68 » Thu Nov 23, 2017 8:37 am

Vi seguo con interesse, una parola sul vostro operato, Braviii :geek:
renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Thu Nov 23, 2017 11:03 pm

Alex68 wrote:
Thu Nov 23, 2017 8:37 am
Vi seguo con interesse,
Spero di pubblicare presto questo
strutture.png
strutture.png (60.67 KiB) Viewed 651 times
renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Fri Nov 24, 2017 11:17 pm

Per provare gli ultimi aggiornamenti vedere in https://forum.freecadweb.org/viewtopic. ... 10#p200996

Fate sapere se riscontrate errori.

Renato
User avatar
Anam
Posts: 39
Joined: Mon Mar 20, 2017 10:22 am
Location: Teramo, Italy

Re: Capannone mettallico in FreeCad

Postby Anam » Sat Nov 25, 2017 8:08 am

Alex68 wrote:
Thu Nov 23, 2017 8:37 am
Vi seguo con interesse, una parola sul vostro operato, Braviii :geek:
Grazie, anche se onestamente è tutto merito di Renato :D :D
renatorivo wrote:
Fri Nov 24, 2017 11:17 pm
Per provare gli ultimi aggiornamenti vedere in https://forum.freecadweb.org/viewtopic. ... 10#p200996
Fate sapere se riscontrate errori.
Renato
Grande Renato, davvero ottimo lavoro! Non vedo l'ora di provare le nuove librerie, ma alla fine hai scoperto il mistero del posizionamento degli oggetti Structure ?

Se riesco provo a implementare i profili accoppiati, nella pratica i profili UPN e L sono usati più a coppie che singolarmente
renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Sun Nov 26, 2017 6:19 pm

Anam wrote:
Sat Nov 25, 2017 8:08 am
ma alla fine hai scoperto il mistero del posizionamento degli oggetti Structure ?
Questo è risolto. Sbagliavo io nell'inserire gli elementi.

Ho anche fatto alcune prove per il posizionamento automatico rispetto a uno spigolo.
Un primo modo richiede di creare una nuova classe in Arch, dove la posizione sia spostata del valore desiderato. Funziona, ma è noioso, e si deve rifare per ogni nuova posizione. Di buono c'è che si possono inserire le strutture usando i punti di uno schizzo e che l'offset vale anche in Flamingo.
Ecco il risultato con un profilo rettangolare.
rect1.png
rect1.png (36.88 KiB) Viewed 560 times
rect1-flamingo.png
rect1-flamingo.png (61.22 KiB) Viewed 560 times
Altro modo consiste nel creare un profilo con Draft con l'offset desiderato, inserirlo in un Profiles_set di Flamingo e poi usare il FrameLineManager per distribuire le strutture. E' un po' difficile gestire bene la posizione.
Ecco un esempio in questo secondo modo
rect2.png
rect2.png (61.77 KiB) Viewed 560 times
User avatar
Anam
Posts: 39
Joined: Mon Mar 20, 2017 10:22 am
Location: Teramo, Italy

Re: Capannone mettallico in FreeCad

Postby Anam » Mon Nov 27, 2017 7:35 am

renatorivo wrote:
Sun Nov 26, 2017 6:19 pm
Un primo modo richiede di creare una nuova classe in Arch, dove la posizione sia spostata del valore desiderato. Funziona, ma è noioso, e si deve rifare per ogni nuova posizione.
Mmm ok, io penso che costruire una classe in grado di accettare una variabile tipo 1,2,3... che specifica la posizione dell'origine sia una cosa fattibile e utile. Ad esempio, nello script che ho postato tempo fa, vengono prima calcolate le coordinate dei punti rispetto a un sistema di riferimento e poi viene aggiunta una traslazione che posizione l'origine sul baricentro. Sul piano della sezione, secondo me è relativamente facile gestire le traslazioni e anche le rotazioni. Non saprei come fare l'interfaccia....
renatorivo
Posts: 2023
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Capannone mettallico in FreeCad

Postby renatorivo » Mon Nov 27, 2017 8:34 pm

Anam wrote:
Mon Nov 27, 2017 7:35 am
Mmm ok, io penso che costruire una classe in grado di accettare una variabile tipo 1,2,3... che specifica la posizione dell'origine sia una cosa fattibile e utile. Ad esempio, nello script che ho postato tempo fa, vengono prima calcolate le coordinate dei punti rispetto a un sistema di riferimento e poi viene aggiunta una traslazione che posizione l'origine sul baricentro. Sul piano della sezione, secondo me è relativamente facile gestire le traslazioni e anche le rotazioni.
Forse in questo siamo a buon punto. Dato che le forme a spigoli vivi non sono molto belle ho cercato di creare dei profili con spigoli arrotondati, secondo UNI 5783 e 5784. Chris_G mi ha fornito un codice in https://forum.freecadweb.org/viewtopic. ... 65#p201386 che funziona perfettamente per questo scopo, e che probabilmente è anche buono per creare i profili seguendo il tuo script.
Ho implementato il codice ed i presets in FreeCAD0.17-12619, e poi ho provato se funziona in flamingo. Ecco una schermata di esempio
struttura-angoli-arrotondati.png
struttura-angoli-arrotondati.png (84.39 KiB) Viewed 516 times
Mi sembra tutto valido. Con qualche modifica al codice si dovrebbe poter impostare facilmente la posizione della struttura.
Ora l'interfaccia....eventuali aiuti sono veramente graditi.