Hatch patterns on Draft objects
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Hatch patterns on Draft objects
I have the problem that hatching only works when the face is parallel to the xy-ground.
I have created facebinder objects from faces of my part and I can add a hatch only to these special faces.
in the other cases i get z-parallel lines (like projections from the xy-pattern down the z-axis)
they do not change when rotate the facebinders down to the xy-plane.
the problem is reconstructable with a simple cube.
I have created facebinder objects from faces of my part and I can add a hatch only to these special faces.
in the other cases i get z-parallel lines (like projections from the xy-pattern down the z-axis)
they do not change when rotate the facebinders down to the xy-plane.
the problem is reconstructable with a simple cube.
- Attachments
-
- bn_520.png (33.62 KiB) Viewed 4422 times
Re: Hatch patterns on Draft objects
Interesting... I never tried applying patterns on non-horizontal (XY) objects... I'll have a look, maybe there is sometihng to tweak in the mapping.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Hatch patterns on Draft objects
Hello Yorik,
can you tell me how fast you can investigate this
if you say this is fixed in 2 weeks that is okay.
if there is no time or too difficult - it is okay too. i will make a workaround - create a simple copy of a face, place it right and put a texture on it.
and when the master part changes i repeat the procedure with a script.
i only want to avoid parallel work.
thanks for a short feedback..
can you tell me how fast you can investigate this
if you say this is fixed in 2 weeks that is okay.
if there is no time or too difficult - it is okay too. i will make a workaround - create a simple copy of a face, place it right and put a texture on it.
and when the master part changes i repeat the procedure with a script.
i only want to avoid parallel work.
thanks for a short feedback..
Re: Hatch patterns on Draft objects
I cannot tell you when I'll have the time to do this unfortunately, sorry.
If you want to try for yourself, you must try to add textures to objects with pivy, and find the way to apply a different mapping until it works. The code that does this is in Draft.py in _ViewProviderDraft.onChanged() (line 3140)
Other people already played with pivy and textures too, there should be more here on the forum.
If you want to try for yourself, you must try to add textures to objects with pivy, and find the way to apply a different mapping until it works. The code that does this is in Draft.py in _ViewProviderDraft.onChanged() (line 3140)
Other people already played with pivy and textures too, there should be more here on the forum.
Re: Hatch patterns on Draft objects
ahh that was me: viewtopic.php?f=23&t=7216 I did not have the problem with the planes described here.yorik wrote:Other people already played with pivy and textures too, there should be more here on the forum.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Hatch patterns on Draft objects
thank you all for the feedback, I was some days backcountry in the snow of austria. tomorrow I will start my try to iron the pattern to the oblique faces.
Re: Hatch patterns on Draft objects
In any case, patterns work for non-XY objects, but only 2D objects. Indeed facebinder objects have never been tested... I guess for 3D objects the mapping works differently.
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Hatch patterns on Draft objects
I have changed the scaling of the SoTextureCoordinatePlane
the result is for facebinder planes parallel to xy the same as the original code,
for the other planes the results are acceptable for me.
there is still an other problem: the attach method is <EDIT: NOT called automaticly after opening the file , so I have to run the onChanged manually to get the correct presentation.
Code: Select all
self.texcoords.directionS.setValue(s,0,0)
self.texcoords.directionT.setValue(0,s,0)
# hack line 3187
self.texcoords.directionS.setValue(s,0, s)
self.texcoords.directionT.setValue(0,s, s)
for the other planes the results are acceptable for me.
there is still an other problem: the attach method is <EDIT: NOT called automaticly after opening the file , so I have to run the onChanged manually to get the correct presentation.
- Attachments
-
- m0_pattern_vorlage.fcstd
- the test file
- (13.88 KiB) Downloaded 118 times
-
- the faces without hack
- bn_525.png (7.88 KiB) Viewed 4194 times
-
- the faces of a cube with all pattern with hack
- bn_527.png (23.1 KiB) Viewed 4194 times
Re: Hatch patterns on Draft objects
xposting thread Progress on PAT Compatible Hatching viewtopic.php?f=8&t=19897
wandererfan wrote:I've made some progress towards PAT compatible hatching:
FirstCrosshatch.png
These hatches are exportable to Svg:
FirstHatchSvgExport.png
Does anybody know what units the intervals between lines are in? I'm using mm since that seems most natural to FC.
Haven't tried to implement dashed lines yet. No performance tests yet either.
Will let you know how I make out.
wf
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
- wandererfan
- Veteran
- Posts: 6317
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Hatch patterns on Draft objects
These are only vaguely related. PAT hatching only applies to TechDraw drawings, while "Hatch patterns on Draft objects" refers mainly to the 3D view.Kunda1 wrote:xposting thread Progress on PAT Compatible Hatching viewtopic.php?f=8&t=19897