Hatch patterns on Draft objects

Info about new implemented features, classes, modules or APIs. Might get technical!
User avatar
microelly2
Posts: 2362
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Hatch patterns on Draft objects

Postby microelly2 » Fri Feb 13, 2015 8:13 pm

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.
Attachments
bn_520.png
bn_520.png (33.62 KiB) Viewed 1307 times
User avatar
yorik
Site Admin
Posts: 8563
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Hatch patterns on Draft objects

Postby yorik » Fri Feb 13, 2015 9:03 pm

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.
User avatar
microelly2
Posts: 2362
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Hatch patterns on Draft objects

Postby microelly2 » Tue Feb 17, 2015 12:28 pm

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..
User avatar
yorik
Site Admin
Posts: 8563
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Hatch patterns on Draft objects

Postby yorik » Thu Feb 19, 2015 3:26 pm

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.
User avatar
bernd
Posts: 3872
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: Hatch patterns on Draft objects

Postby bernd » Fri Feb 20, 2015 11:24 am

yorik wrote:Other people already played with pivy and textures too, there should be more here on the forum.

ahh that was me: viewtopic.php?f=23&t=7216 I did not have the problem with the planes described here.
User avatar
microelly2
Posts: 2362
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Hatch patterns on Draft objects

Postby microelly2 » Mon Feb 23, 2015 12:30 am

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.
User avatar
yorik
Site Admin
Posts: 8563
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Hatch patterns on Draft objects

Postby yorik » Mon Feb 23, 2015 3:11 am

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.

draft-hatches.jpg
draft-hatches.jpg (43.31 KiB) Viewed 1105 times
User avatar
microelly2
Posts: 2362
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Hatch patterns on Draft objects

Postby microelly2 » Mon Feb 23, 2015 2:47 pm

I have changed the scaling of the SoTextureCoordinatePlane

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)
 

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.
Attachments
m0_pattern_vorlage.fcstd
the test file
(13.88 KiB) Downloaded 28 times
bn_525.png
the faces without hack
bn_525.png (7.88 KiB) Viewed 1079 times
bn_527.png
the faces of a cube with all pattern with hack
bn_527.png (23.1 KiB) Viewed 1079 times
User avatar
Kunda1
Posts: 635
Joined: Thu Jan 05, 2017 9:03 pm

Re: Hatch patterns on Draft objects

Postby Kunda1 » Sat Jan 14, 2017 9:35 pm

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
wandererfan
Posts: 887
Joined: Tue Nov 06, 2012 5:42 pm

Re: Hatch patterns on Draft objects

Postby wandererfan » Sun Jan 15, 2017 12:43 pm

Kunda1 wrote:xposting thread Progress on PAT Compatible Hatching viewtopic.php?f=8&t=19897

These are only vaguely related. PAT hatching only applies to TechDraw drawings, while "Hatch patterns on Draft objects" refers mainly to the 3D view.