(SOLVED) Retrieving custom hatch patterns

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

(SOLVED) Retrieving custom hatch patterns

Post by CVH » Thu Sep 24, 2020 7:03 am

Andrew,

Both RhatchEntity and RhatchData have the flag .hasCustomPattern().
I can test this flag to know if the hatch originates from the dxf file.
Both also have the method .getPatternName() what returns the correct pattern name as a string.
And .clearCustomPattern() what clears the custom pattern when casted back.

Both have the method .getCustomPattern() what should return a RPattern.
https://qcad.org/doc/qcad/3.0/developer ... 41f3decae6
In trial .getCustomPattern() returns a QVariant(RPattern) instead.

Obviously all the RPattern methods fail on the QVariant.

How to retrieve the Description, PatternLines and from those the Dashes, BasePoint, Angle, Length and
the Offset what are all getters from the RPattern Class?

Regards,
CVH
Last edited by CVH on Tue Oct 20, 2020 2:26 pm, edited 1 time in total.

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: Retrieving custom hatch patterns

Post by andrew » Fri Sep 25, 2020 3:57 pm

I've updated the RPattern script bindings accordingly, so the problem should be fixed in the next release.

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

Re: Retrieving custom hatch patterns

Post by CVH » Fri Sep 25, 2020 7:51 pm

Thanks, Andrew,
looking forward to it ...

Meanwhile, I dove in the dxf myself.
But I have more confidence in a calibrated approach.

Discovered that a dxf stores the cloning data in Cartesian way.

Funny:
We make a design in Cartesian spaced tiles, our designs are Cartesian recorded.
A PAT file is coded as a parallel offset and an inline shift.
For dxf it is recomputed and stores it back as a Cartesian offset.

This Cartesian data is in a way the base of an alternative hatch generator.
Presuming hatches are parallel patterned lines in QCAD.

Regards,
CVH

CVH
Premier Member
Posts: 3416
Joined: Wed Sep 27, 2017 4:17 pm

(SOLVED) Retrieving custom hatch patterns

Post by CVH » Tue Oct 20, 2020 2:26 pm

Solved with release 3.25.2.1
Tile2Hatch can now extract orphaned hatch patterns from the current drawing. :P

Thanks, Andrew :wink:
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”