[Answered] What type of auxiliary shapes can be add to a preview?

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: 4993
Joined: Wed Sep 27, 2017 4:17 pm

[Answered] What type of auxiliary shapes can be add to a preview?

Post by CVH » Thu Jan 23, 2025 9:35 am

Andrew,

I get: Wrong number/types of arguments for RDocumentInterface.addAuxShapeToPreview()
The documentation states: Todo: Support other shapes.

Questions:
- What RShape types are currently supported?
- And does that include QSharedPointers (Qt5-based)?
- How hard would it be to support all Math based RShape's?

Already degraded from RSpline to a segmented RPolyline, next would be to degrade to individual RLine segments.
Then RPolyline.getExploded() returns a QList with QSharedPointers but I can also mimic the required shape directly as a chain of RLine segments.
I then foresee an issue with the fixed dashes {10,5,2,5} as pattern for each minute segment ... Or is that globally distributed?

For the record, the shape to mimic is the evolute of an ellipse so that a user may expect 4,3 or just 2 normal's to an ellipse.

Regards,
CVH
Last edited by CVH on Mon Feb 10, 2025 6:46 am, edited 1 time in total.

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

Re: What type of auxiliary shapes can be add to a preview?

Post by CVH » Sat Feb 08, 2025 11:12 am

No details were given ...
Let us then trial each type and list it.

RPoint shape : OK
...
RLine shape : OK
...
RRay shape : OK
...
RXLine shape : OK
...
RArc shape : OK
...
RCircle shape : OK
...
REllipse shape : OK (As full and as arc)
...
RPolyline Shape : OK (2-N vertices, N bulges, closed or not)
...
RSpline Shape (CP) : OK (Direct definition or with setting CP)
...
RSpline Shape (FP) : OK (Pro: With setting FP)
...
RTriangle Shape : OK
...
RBox Math Shape : di.addAuxShapeToPreview(...) > RDocumentInterface: Argument 0 is not of type RShape*

And this concludes the list of all simple shapes listed under qcad/src/core/math/
All RShape's seems to be supported: RShape Class Reference

What shapes are then referred to with the ToDo statement?
Perhaps it is simply the QCAD Application Framework reference that is not up to date (Generated on Thu Apr 15 2021 10:10:22)

I know that everthing is slowy geared to QSharedPointer's !?
The parallel shape of for example the above RLine type or RArc type test case failed because that are pointers.


Conclusion: The evolute as segmented RPolyline or as Spline must be possible ... :?
# EDIT # The reason they failed in the first place may have something to do with arrays.

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”