Convert .PAT files to SVG patterns?

Anyone know of a good way to convert .PAT files to SVG patterns?

Comments

  • edited August 2023

    It seems GIMP is able to import .pat files ? I'm not familiar with the format, what kind of softwares does it come from ? Is it a binary or ascii file ?

  • Gives you an idea: https://pattycake.io/
    Various cad/bim programs use it, for patterns.

    Coenduarteframos
  • I tried to solve this problem years ago, without any usable success.

    IIRC the main problem was pat file works totally differently than an svg pattern. Svg pattern is always rectangular (actually a parallelogram after transformations), and it's just repeated in 2 dimensions on the plane. In pat each line lives in its own coordinate system, parallel to the line. If a pat pattern contains more than one line, you cannot create a parallelogram which is repeated simply as an svg pattern. So you have to convert each pat line to a separate svg pattern. It needed a lot of math and trigonometry and after my brain started to hurt I just gave up :)

    I was very new to programming back than, maybe nowadays I could solve this, thanks for the heads up, to remind me to another unfinished project :)


    About the pat file format: there are 2 different unrelated pat files: the one in GIMP comes from Photoshop originally and I don't know anything about it, but it's different. The CAD one originally comes from AutoCAD, it's ascii. Afaik there are 2 main versions of it, the AutoCAD one and the Revit one, they are mostly the same, AutoCAD one has some limitations. FreeCAD also uses this pat file in some cases.

    The default Revit pat file contains some documentation, I copied here some relevant info:

    ;;; Line families
    ;
    ; Each line family is a set of parallel lines that build one "direction" of a pattern. A complete
    ; pattern may be defined by several families each defining part of the final, such as the vertical
    ; joints of brick coursing. The lines are described in the two dimensions of a face as follows:
    ; 
    ;    angle, x-origin, y-origin, shift, offset, dash, space, dash, space ...
    ;
    ; Angle specifies the direction, in degrees, of a set of lines relative to the x-axis. The first
    ; line in the set starts at the specified x,y-origin. Parallel lines are drawn as specified by
    ; Offset and Shift to fill the entire face. Offset defines the distance between parallel lines.
    ; Zero Offset is not allowed. Shift moves the pattern of dashes and spaces along the length of
    ; each new parallel line. Shift is ignored if the line is solid. Distances are expressed as
    ; decimal numbers (using peroid as the decimal separator) in the units previously specified.
    ;
    ; The dash-space sequence defines a repeating pattern of dashes and spaces for a line. If it is
    ; omitted, the line is solid. Positive numbers define dashes, negative numbers define spaces, and
    ; zero specifies a dot. If you begin a pattern with a space, do not alternate dashes and spaces,
    ; or do not end with a space, Revit will introduce tiny dashes or spaces to compensate. Revit
    ; expands dots and very short dashes into dashes of a minimum size.
    ;
    ;;; Worked example
    ;
    ;    ;%UNITS=INCH
    ;    ;%VERSION=3.0
    ;
    ;    *Block 8x16,  8 x 16 blocks running bond
    ;    ;%TYPE=MODEL
    ;    0,             0,             0,             0,             8
    ;    90,            0,             0,             8,             8,             8,             -8
    ;
    ; This pattern is called "Block 8x16"; you will see this name when you import it into Revit. It is
    ; a model pattern. It has two families of lines. The first family creates the horizontal coursing:
    ;
    ;    angle = 0          => lines are horizontal
    ;    x,y-origin = 0,0
    ;    shift = 0          => line pattern is not shifted
    ;    offset = 8         => consecutive lines are 8 model inches apart
    ;    no line pattern    => the line is solid.
    ;
    ; The second family creates the vertical joints:
    ;
    ;    angle = 90         => lines are vertical
    ;    x,y-origin = 0,0   => the pattern begins at the same point as the horizontals
    ;    shift = 8          => line pattern is is shifted by 8 model inches for consecutive lines
    ;    offset = 8         => consecutive lines are 8 model inches apart
    ;    dash = 8           => each line is built of 8" dashes and 8" spaces
    ;    space = 8          => this pattern repeats until the face boundary
    ;
    ; The shift makes the vertical segments appear between alternating pairs of horizontal lines,
    ; which appears as 16 inch bricks in interlocking bond.
    ;
    ;;; Differences from AutoCAD
    ;
    ; - AutoCAD has an 80-character line size limit, Revit's is 4096.
    ; - AutoCAD allows arbitrary sequences of dashes, spaces and dots, Revit coerces them into dash-
    ;   space format by inserting zero spaces and dashes.
    ; - AutoCAD has a notion of dots, Revit expands them (including the zero dashes it inserted) into
    ;   short dashes.
    ; - AutoCAD has a maximum of 6 components to a line pattern, Revit has no limit.
    ; - AutoCAD does not allow spaces in a pattern name, Revit does.
    ; - AutoCAD allows only one pattern per a custom file, with pattern name matching file name, and
    ;   with the file residing in a known location. Revit has none of these restrictions.
    ; - AutoCAD and Revit utilize different logic to decide whether a pattern is acceptable.
    ;
    ; Note that when Revit exports its models into AutoCAD formats, such as DWG, it makes sure to
    ; comply with the more stringent AutoCAD requirements.
    
    theoryshawCoenAceGorgious
  • edited March 26

    Hi all! I have a problem with the orientation of fill patterns for the BBIM roof.
    How do I get the patterns to be aligned to the direction of the blue arrows as indicated on below; attached file
    Secondly, why do I have these unwanted triangulations (see 4 red marked) on the roof after creating the drawing?
    I have a particular fill pattern for the walls in plan below; plan but then it appears in elevation too which I don't need;
    How do I do Visibility/ Graphics Override in BBIM? I have done what I could but with no success!
    Also, observe the unnecessary triangulation at the rooftop (red circle).
    Thank you.
    NB: Any success also on the search to "Convert .PAT files to SVG patterns?"

  • How do I get the patterns to be aligned to the direction of the blue arrows as indicated on below;

    Unfortunately i don't think there's a way to do this yet. This would be a nice feature request.

    How do I do Visibility/ Graphics Override in BBIM?

    one way: https://www.dropbox.com/scl/fi/ym3ujgxgafgkqijpl6msa/2024-03-26_16-33-58_chromeNORTHEAST_ELEVATION.svg_-_Google_Chromechrome.mp4?rlkey=ph6gwxyt67cjmpo20s9d8q1l2&dl=0

    Owura_qu
  • NB: Any success also on the search to "Convert .PAT files to SVG patterns?"

    Haven't found anything.

    Owura_qu
  • Thank you very much and this seems to do the job for now.

Sign In or Register to comment.